Skip to content

Commit

Permalink
Merge pull request #828 from oskarhane/no-caching-guides
Browse files Browse the repository at this point in the history
Send cache busting headers with remote guides requests
  • Loading branch information
pe4cey authored Sep 26, 2018
2 parents 1f85b04 + 0e5398b commit 7f4f5be
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:8-jessie

WORKDIR /usr/src

# Install dependencies
COPY package.json yarn.lock ./
RUN yarn

# Copy the relevant files to the working directory
COPY . .

# Build and export the app
RUN yarn build
RUN cp -R dist /public
19 changes: 1 addition & 18 deletions now.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
{
"name": "neo4j-browser",
"engines": {
"node": "^8.11.2"
},
"public": true,
"files": [
"scripts/",
"src/",
".babelrc",
".eslintignore",
".eslintrc.json",
".yarnrc",
"cypress.json",
"jsconfig.json",
"postcss.config.js",
"webpack.config.js",
"yarn.lock",
"README.md"
]
"type": "static"
}
8 changes: 5 additions & 3 deletions src/shared/modules/commands/helpers/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ export const fetchRemoteGuide = (url, whitelist = null) => {
}
resolve()
}).then(() => {
return remote.get(url).then(r => {
return cleanHtml(r)
})
return remote
.get(url, { pragma: 'no-cache', 'cache-control': 'no-cache' })
.then(r => {
return cleanHtml(r)
})
})
}
5 changes: 3 additions & 2 deletions src/shared/services/remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ function request (method, url, data = null, extraHeaders = {}) {
}).then(checkStatus)
}

function get (url) {
function get (url, headers = {}) {
return fetch(url, {
method: 'get'
method: 'get',
headers
})
.then(checkStatus)
.then(function (response) {
Expand Down

0 comments on commit 7f4f5be

Please sign in to comment.