Bust cache with version
parent
c679a5f2d1
commit
16f1562ade
|
@ -69,6 +69,7 @@ class PageController extends Controller {
|
||||||
// Apps enabled
|
// Apps enabled
|
||||||
$this->initialState->provideInitialState('systemtags', $this->appManager->isEnabledForUser('systemtags') === true);
|
$this->initialState->provideInitialState('systemtags', $this->appManager->isEnabledForUser('systemtags') === true);
|
||||||
$this->initialState->provideInitialState('recognize', $this->appManager->isEnabledForUser('recognize') === true);
|
$this->initialState->provideInitialState('recognize', $this->appManager->isEnabledForUser('recognize') === true);
|
||||||
|
$this->initialState->provideInitialState('version', $this->appManager->getAppInfo('memories')["version"]);
|
||||||
|
|
||||||
$response = new TemplateResponse($this->appName, 'main');
|
$response = new TemplateResponse($this->appName, 'main');
|
||||||
return $response;
|
return $response;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { getCanonicalLocale } from "@nextcloud/l10n";
|
import { getCanonicalLocale } from "@nextcloud/l10n";
|
||||||
import { getCurrentUser } from '@nextcloud/auth'
|
import { getCurrentUser } from '@nextcloud/auth'
|
||||||
|
import { loadState } from '@nextcloud/initial-state'
|
||||||
import { IPhoto } from "../types";
|
import { IPhoto } from "../types";
|
||||||
|
|
||||||
// Memoize the result of short date conversions
|
// Memoize the result of short date conversions
|
||||||
|
@ -166,7 +167,8 @@ export const constants = {
|
||||||
|
|
||||||
/** Cache store */
|
/** Cache store */
|
||||||
let cacheStorage: Cache | null = null;
|
let cacheStorage: Cache | null = null;
|
||||||
caches.open(`memories-${getCurrentUser()!.uid}`).then((cache) => { cacheStorage = cache });
|
const cacheName = `memories-${loadState('memories', 'version')}-${getCurrentUser()!.uid}`;
|
||||||
|
caches.open(cacheName).then((cache) => { cacheStorage = cache });
|
||||||
|
|
||||||
/** Get data from the cache */
|
/** Get data from the cache */
|
||||||
export async function getCachedData(url: string) {
|
export async function getCachedData(url: string) {
|
||||||
|
|
Loading…
Reference in New Issue