mirror of
https://github.com/ssyyhhrr/stewardle.git
synced 2025-11-16 22:03:40 -05:00
No Cache Fix
This commit is contained in:
9
app.js
9
app.js
@@ -226,7 +226,14 @@ function server() {
|
||||
app.enable("trust proxy")
|
||||
|
||||
app.use(express.urlencoded({ extended: true }))
|
||||
app.use(express.static("assets"))
|
||||
app.use(express.static("assets", {
|
||||
setHeaders: function(res, path, stat) {
|
||||
// Set cache control headers
|
||||
res.set('Cache-Control', 'no-cache, no-store, must-revalidate');
|
||||
res.set('Pragma', 'no-cache');
|
||||
res.set('Expires', '0');
|
||||
}
|
||||
}))
|
||||
app.use(favicon('assets/favicon.ico'))
|
||||
app.use(morgan("combined"))
|
||||
|
||||
|
||||
@@ -526,7 +526,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
}
|
||||
let scores = JSON.parse(localStorage.scores)
|
||||
fillStats(stats, scores)
|
||||
fetch(`${window.location.href}/drivers.json?nocache=${new Date().getTime()}`).then(res => {
|
||||
fetch(`${window.location.href}/drivers.json`).then(res => {
|
||||
res.json().then(result => {
|
||||
driversObj = result
|
||||
Object.entries(result).forEach(driver => {
|
||||
|
||||
Reference in New Issue
Block a user