mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
Bust clientside caches
This commit is contained in:
parent
c2dd9e84a3
commit
3a2492160e
2 changed files with 6 additions and 2 deletions
|
@ -171,8 +171,12 @@ function listenAutocomplete() {
|
||||||
|
|
||||||
function fetchLocalAutocomplete(event) {
|
function fetchLocalAutocomplete(event) {
|
||||||
if (!localFetched && event.target.dataset && 'ac' in event.target.dataset) {
|
if (!localFetched && event.target.dataset && 'ac' in event.target.dataset) {
|
||||||
|
const now = new Date();
|
||||||
|
const cacheKey = `${now.getUTCFullYear()}-${now.getUTCMonth()}-${now.getUTCDate()}`;
|
||||||
|
|
||||||
localFetched = true;
|
localFetched = true;
|
||||||
fetch('/autocomplete/compiled?vsn=2', { credentials: 'omit', cache: 'force-cache' })
|
|
||||||
|
fetch(`/autocomplete/compiled?vsn=2&key=${cacheKey}`, { credentials: 'omit', cache: 'force-cache' })
|
||||||
.then(handleError)
|
.then(handleError)
|
||||||
.then(resp => resp.arrayBuffer())
|
.then(resp => resp.arrayBuffer())
|
||||||
.then(buf => localAc = new LocalAutocompleter(buf));
|
.then(buf => localAc = new LocalAutocompleter(buf));
|
||||||
|
|
|
@ -106,7 +106,7 @@ function loadBooruData() {
|
||||||
function BooruOnRails() {
|
function BooruOnRails() {
|
||||||
this.apiEndpoint = '/api/v2/';
|
this.apiEndpoint = '/api/v2/';
|
||||||
this.hiddenTag = '/images/tagblocked.svg';
|
this.hiddenTag = '/images/tagblocked.svg';
|
||||||
this.tagsVersion = 5;
|
this.tagsVersion = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
window.booru = new BooruOnRails();
|
window.booru = new BooruOnRails();
|
||||||
|
|
Loading…
Reference in a new issue