Spaces:
Paused
Paused
T1ckbase
commited on
Commit
·
fb8feb1
1
Parent(s):
a0040c1
add Cache-Control
Browse files
main.ts
CHANGED
|
@@ -33,6 +33,7 @@ app.get('/cell/:row/:col/image', (c) => {
|
|
| 33 |
if (!cellImage) return c.text(`Not Found: Image for cell (${row}, ${col}) could not be found. Coordinates may be invalid or no image is defined for this cell state.`, 404);
|
| 34 |
|
| 35 |
c.header('Content-Type', 'image/svg+xml');
|
|
|
|
| 36 |
return c.body(cellImage);
|
| 37 |
});
|
| 38 |
|
|
@@ -61,9 +62,11 @@ app.get('/cell/:row/:col/click', (c) => {
|
|
| 61 |
});
|
| 62 |
|
| 63 |
app.get('/game/status', (c) => {
|
| 64 |
-
c.header('Content-Type', 'image/svg+xml');
|
| 65 |
const image = minesweeper.getGameStatusImage();
|
| 66 |
if (!image) return c.text('Status image is not available.', 404);
|
|
|
|
|
|
|
|
|
|
| 67 |
return c.body(image);
|
| 68 |
});
|
| 69 |
|
|
|
|
| 33 |
if (!cellImage) return c.text(`Not Found: Image for cell (${row}, ${col}) could not be found. Coordinates may be invalid or no image is defined for this cell state.`, 404);
|
| 34 |
|
| 35 |
c.header('Content-Type', 'image/svg+xml');
|
| 36 |
+
c.header('Cache-Control', 'no-cache, no-store, must-revalidate');
|
| 37 |
return c.body(cellImage);
|
| 38 |
});
|
| 39 |
|
|
|
|
| 62 |
});
|
| 63 |
|
| 64 |
app.get('/game/status', (c) => {
|
|
|
|
| 65 |
const image = minesweeper.getGameStatusImage();
|
| 66 |
if (!image) return c.text('Status image is not available.', 404);
|
| 67 |
+
|
| 68 |
+
c.header('Content-Type', 'image/svg+xml');
|
| 69 |
+
c.header('Cache-Control', 'no-cache, no-store, must-revalidate');
|
| 70 |
return c.body(image);
|
| 71 |
});
|
| 72 |
|