Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove of no-cache since its not correctly used when scripts are not loaded #5041

Closed
wants to merge 1 commit into from

Conversation

ptomasroos
Copy link
Contributor

@ptomasroos ptomasroos commented Aug 28, 2018

"no-cache" indicates that the returned response can't be used to satisfy a subsequent request to the same URL without first checking with the server if the response has changed. As a result, if a proper validation token (ETag) is present, no-cache incurs a roundtrip to validate the cached response, but can eliminate the download if the resource has not changed.

We do not respond with a E-TAG since there is no resource for this.

By contrast, "no-store" is much simpler. It simply disallows the browser and all intermediate caches from storing any version of the returned response—for example, one containing private personal or banking data. Every time the user requests this asset, a request is sent to the server and a full response is downloaded.

Or we could skip the semantically correct and just return status code 500 when there is a wrong INVALID_BUILD_ID. In my feeling this only happens when upgrading a web service across multiple nodes.

User hits A and gets the server response, then fetches the scripts which hit B which isn't upgraded yet and that returns 404. In the best of the worlds the user should now navigate again and everything will be resolved. But what happens when the 404 gets stucked is very troublesome as its not resolvable by the client. And CDN's never caches 500's. So I would say this is more correct to avoid the problem.

"no-cache" indicates that the returned response can't be used to satisfy a subsequent request to the same URL without first checking with the server if the response has changed. As a result, if a proper validation token (ETag) is present, no-cache incurs a roundtrip to validate the cached response, but can eliminate the download if the resource has not changed.

We do not respond with a E-TAG since there is no resource for this. 

```
By contrast, "no-store" is much simpler. It simply disallows the browser and all intermediate caches from storing any version of the returned response—for example, one containing private personal or banking data. Every time the user requests this asset, a request is sent to the server and a full response is downloaded.
```
@ptomasroos ptomasroos closed this Aug 28, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Aug 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant