Skip to content
Snippets Groups Projects

Resolve "Investigate issue with the caching of files in backblaze"

Files
4
@@ -32,10 +32,7 @@ class CloudflareService {
}
fetchFile(fileName, bucket = this._defaultBucket) {
return __awaiter(this, void 0, void 0, function* () {
// v?= is a dirty fix to prevent caching of the CORS error response in case file is missing.
// Because of browser caching CORS error in case of missing file, it's not possible to retrieve it when it's being uploaded.
// Dig into https://www.backblaze.com/b2/docs/cors_rules.html and fix
const response = yield axios_1.default(`${this._cdnUrl}/file/${bucket}/${fileName}?v=${Math.random()}`);
const response = yield axios_1.default(`${this._cdnUrl}/file/${bucket}/${fileName}`);
const data = response.data;
const uploadTime = response.headers["x-bz-upload-timestamp"]
? parseInt(response.headers["x-bz-upload-timestamp"])
Loading