Skip to content

Commit

Permalink
15 minute cacheBuster
Browse files Browse the repository at this point in the history
  • Loading branch information
aorcsik committed Sep 24, 2024
1 parent 3681845 commit 619feac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/js/changelog/ChangelogService.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ class ChangelogService {
* @returns {Promise<ChangelogTopic[]>}
*/
async loadTopics(changelogUrl) {
const chacheBuster = new Date().toISOString().split(':')[0].replace(/[^\d]/g, '');
const url = `${this.apiBase + changelogUrl}?_=${chacheBuster}`;
const d = new Date().toISOString().split(':');
const cacheBuster = `${d[0].replace(/[^\d]/g, '')}${Math.floor(d[1] / 15)}`;
const url = `${this.apiBase + changelogUrl}?_=${cacheBuster}`;
const response = await fetch(url);
const json = await response.json();
return json.topic_list.topics.map((data) => new ChangelogTopic(data));
Expand Down

0 comments on commit 619feac

Please sign in to comment.