Skip to content

Commit 28fcbac

Browse files
committed
Disable caching linkry responses
1 parent 6946d3f commit 28fcbac

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

terraform/modules/frontend/main.tf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,20 +256,25 @@ async function handler(event) {
256256
}
257257
}
258258
}
259+
let statusCode = 307;
260+
let statusDescription = 'Not Found';
259261
let redirectUrl = "https://acm.illinois.edu/404";
260262
try {
261263
const value = await kvs.get(path);
262264
if (value) {
263265
redirectUrl = value;
266+
statusCode = 302;
267+
statusDescription = 'Found'
264268
}
265269
} catch (err) {
266270
console.log(`KVS key lookup failed for $!{path}: $!{err}`);
267271
}
268272
var response = {
269-
statusCode: 302,
270-
statusDescription: 'Found',
273+
statusCode: statusCode,
274+
statusDescription: statusDescription,
271275
headers: {
272276
'location': { value: redirectUrl }
277+
'cache-control': { value: 'no-cache, no-store, must-revalidate' }
273278
}
274279
};
275280
return response;

0 commit comments

Comments
 (0)