Use cache version in resource hashes

This commit is contained in:
eraseyourknees@gmail.com 2022-08-25 17:31:20 +02:00
parent 6e4e53ade8
commit aa86232bd3

View File

@ -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;
} }