Skip to content

Commit

Permalink
Merge pull request #124 from Carifio24/no-cache-count
Browse files Browse the repository at this point in the history
Set headers to prevent caching of Hubble class measurement count responses
  • Loading branch information
Carifio24 authored Aug 1, 2024
2 parents 76bda8d + d7bc262 commit 85500f1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/stories/hubbles_law/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ router.get("/sample-galaxy", async (_req, res) => {
});

router.get("/class-measurements/size/:studentID/:classID", async (req, res) => {
res.header("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1
res.header("Pragma", "no-cache"); // HTTP 1.0
res.header("Expires", "0"); // Proxies
const studentID = parseInt(req.params.studentID);
const isValidStudent = (await findStudentById(studentID)) !== null;
if (!isValidStudent) {
Expand Down

0 comments on commit 85500f1

Please sign in to comment.