diff options
author | Zero~Informatique | 2020-02-13 17:44:34 +0100 |
---|---|---|
committer | Zero~Informatique | 2020-02-13 17:44:34 +0100 |
commit | 1763c8ce725098100618079553a9ec4f79386a5d (patch) | |
tree | cceb8f2d292f59cf53c508160ffa11da1c73386b | |
parent | ee9d82d0b307dee1c9138babf954a3864a0c2f83 (diff) | |
download | ldgallery-1763c8ce725098100618079553a9ec4f79386a5d.tar.gz |
viewer: no-cache for config.json and index.json
-rw-r--r-- | example/config.json | 1 | ||||
-rw-r--r-- | viewer/public/config.json.example | 1 | ||||
-rw-r--r-- | viewer/src/@types/gallery.d.ts | 1 | ||||
-rw-r--r-- | viewer/src/store/galleryStore.ts | 4 |
4 files changed, 2 insertions, 5 deletions
diff --git a/example/config.json b/example/config.json index 6487594..51baf84 100644 --- a/example/config.json +++ b/example/config.json | |||
@@ -1,4 +1,3 @@ | |||
1 | { | 1 | { |
2 | "generationTimestamp": 0, | ||
3 | "galleryRoot": "out/" | 2 | "galleryRoot": "out/" |
4 | } \ No newline at end of file | 3 | } \ No newline at end of file |
diff --git a/viewer/public/config.json.example b/viewer/public/config.json.example index 7023edb..90c5f74 100644 --- a/viewer/public/config.json.example +++ b/viewer/public/config.json.example | |||
@@ -1,4 +1,3 @@ | |||
1 | { | 1 | { |
2 | "generationTimestamp": 0, | ||
3 | "galleryRoot": "gallery/" | 2 | "galleryRoot": "gallery/" |
4 | } \ No newline at end of file | 3 | } \ No newline at end of file |
diff --git a/viewer/src/@types/gallery.d.ts b/viewer/src/@types/gallery.d.ts index 865f621..44eecf6 100644 --- a/viewer/src/@types/gallery.d.ts +++ b/viewer/src/@types/gallery.d.ts | |||
@@ -19,7 +19,6 @@ | |||
19 | 19 | ||
20 | declare namespace Gallery { | 20 | declare namespace Gallery { |
21 | interface Config { | 21 | interface Config { |
22 | generationTimestamp: number, | ||
23 | galleryRoot: string, | 22 | galleryRoot: string, |
24 | } | 23 | } |
25 | 24 | ||
diff --git a/viewer/src/store/galleryStore.ts b/viewer/src/store/galleryStore.ts index bcd4bc9..6f5f0ad 100644 --- a/viewer/src/store/galleryStore.ts +++ b/viewer/src/store/galleryStore.ts | |||
@@ -66,7 +66,7 @@ export default class GalleryStore extends VuexModule { | |||
66 | 66 | ||
67 | // Fetches the gallery's JSON config | 67 | // Fetches the gallery's JSON config |
68 | @action async fetchConfig() { | 68 | @action async fetchConfig() { |
69 | return fetch(`${process.env.VUE_APP_DATA_URL}config.json`) | 69 | return fetch(`${process.env.VUE_APP_DATA_URL}config.json`, { cache: "no-cache" }) |
70 | .then(config => config.json()) | 70 | .then(config => config.json()) |
71 | .then(this.setConfig); | 71 | .then(this.setConfig); |
72 | } | 72 | } |
@@ -75,7 +75,7 @@ export default class GalleryStore extends VuexModule { | |||
75 | @action async fetchGalleryItems() { | 75 | @action async fetchGalleryItems() { |
76 | const root = this.config?.galleryRoot ?? ''; | 76 | const root = this.config?.galleryRoot ?? ''; |
77 | const timestamp = this.config?.generationTimestamp ?? 0; | 77 | const timestamp = this.config?.generationTimestamp ?? 0; |
78 | return fetch(`${process.env.VUE_APP_DATA_URL}${root}index.json?${timestamp}`) | 78 | return fetch(`${process.env.VUE_APP_DATA_URL}${root}index.json`, { cache: "no-cache" }) |
79 | .then(response => response.json()) | 79 | .then(response => response.json()) |
80 | .then(this.setGalleryItemsRoot) | 80 | .then(this.setGalleryItemsRoot) |
81 | .then(this.indexTags); | 81 | .then(this.indexTags); |