Skip to content

Commit 451e1a6

Browse files
committedApr 17, 2019
feat(headers): add cache headers
1 parent 1162dc9 commit 451e1a6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed
 

‎src/gatsby-node.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,17 @@ exports.sourceNodes = async ({ actions }, { username }) => {
1616
});
1717

1818
// eslint-disable-next-line no-await-in-loop
19-
const res = await axios.get(`https://dev.to/api/articles?${params}`);
19+
const res = await axios.get(`https://dev.to/api/articles?${params}`, {
20+
headers: {
21+
"cache-control": "no-cache",
22+
pragma: "no-cache",
23+
accept:
24+
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
25+
"accept-encoding": "gzip, deflate, br",
26+
"accept-language": "en-GB,en-US;q=0.9,en;q=0.8",
27+
"upgrade-insecure-requests": 1
28+
}
29+
});
2030

2131
// eslint-disable-next-line no-await-in-loop
2232
const { data } = res;

0 commit comments

Comments
 (0)
Please sign in to comment.