Skip to content
Snippets Groups Projects
Commit a9f916be authored by Ole Voldsæter's avatar Ole Voldsæter
Browse files

re meta#343 query-parameter for å omgå dloudfront-cache

parent 3a980693
No related branches found
No related tags found
No related merge requests found
...@@ -112,6 +112,7 @@ Resources: ...@@ -112,6 +112,7 @@ Resources:
HeaderBehavior: whitelist HeaderBehavior: whitelist
Headers: Headers:
- "x-api-key" - "x-api-key"
- cachebuster
Distribution: Distribution:
Type: "AWS::CloudFront::Distribution" Type: "AWS::CloudFront::Distribution"
Properties: Properties:
......
...@@ -91,7 +91,11 @@ axios.interceptors.request.use(function (config) { ...@@ -91,7 +91,11 @@ axios.interceptors.request.use(function (config) {
}); });
function navigate_to_article(self, source) { function navigate_to_article(self, source) {
axios.get(api_endpoint + '/' + self.$route.params.lang + '/article/' + self.$route.params.id) let config = {headers: {}}
if ((self.$route.query.nocache || '').toLowerCase() == 'true') {
config.headers.cachebuster = Date.now()
}
axios.get(api_endpoint + '/' + self.$route.params.lang + '/article/' + self.$route.params.id, config)
.then(function(response){ .then(function(response){
self.article = Object.assign(response.data, {'dictionary': self.$route.params.lang, source: source, results: self.search_results}) self.article = Object.assign(response.data, {'dictionary': self.$route.params.lang, source: source, results: self.search_results})
self.search_results = [] self.search_results = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment