Skip to content

Commit 91a3149

Browse files
committed
remove caching
1 parent eaab1bc commit 91a3149

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/__tests__/routes.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ describe('API Routes', () => {
334334
const res = await request(app).get('/v1/technologies');
335335
expect(res.headers['access-control-allow-origin']).toEqual('*');
336336
expect(res.headers['content-type']).toContain('application/json');
337-
expect(res.headers['cache-control']).toContain('public');
337+
expect(res.headers['cache-control']).toContain('no-cache');
338338
});
339339

340340
it('should include ETag headers for caching', async () => {

src/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ const setCORSHeaders = (res) => {
2626
const setCommonHeaders = (res) => {
2727
setCORSHeaders(res);
2828
res.setHeader('Content-Type', 'application/json');
29-
res.setHeader('Cache-Control', 'public, max-age=21600');
29+
//res.setHeader('Cache-Control', 'public, max-age=21600');
30+
31+
res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
32+
res.setHeader('Pragma', 'no-cache');
33+
res.setHeader('Expires', '0');
3034
res.setHeader('Timing-Allow-Origin', '*');
3135
};
3236

0 commit comments

Comments
 (0)