forked from uup-dump/api
Use cache version in resource hashes
This commit is contained in:
parent
6e4e53ade8
commit
aa86232bd3
@ -17,9 +17,11 @@ limitations under the License.
|
|||||||
|
|
||||||
class UupDumpCache {
|
class UupDumpCache {
|
||||||
private $cacheFile;
|
private $cacheFile;
|
||||||
|
private $newCacheVersion = 1;
|
||||||
|
|
||||||
public function __construct($resource, $compressed = true) {
|
public function __construct($resource, $compressed = true) {
|
||||||
$cacheHash = hash('sha256', strtolower($resource));
|
$res = $resource."+cache_v".$this->newCacheVersion;
|
||||||
|
$cacheHash = hash('sha256', strtolower($res));
|
||||||
$ext = $compressed ? '.json.gz' : '.json';
|
$ext = $compressed ? '.json.gz' : '.json';
|
||||||
$this->cacheFile = 'cache/'.$cacheHash.$ext;
|
$this->cacheFile = 'cache/'.$cacheHash.$ext;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user