Prevent browser bfcache by default #82
Closed
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Back / forward cache seems to be a fairly recent feature browsers seem to rollout.
More information can be found here: https://web.dev/bfcache.
Long story short, when a user for example login then logout from a given application, they could then hit the "Back" button from their browser and access the login page again with the credentials pre-filled as the page would be served from the
bfcache
. This could lead to security concerns, especially on shared devices where someone could inspect the page and retrieve some user credentials.Currently, the sensible defaults for the HTTP cache headers seem to be
no-cache, private
in order to be conservative by default. A lot of applications currently rely on this to be the sensible default for their application too.Replacing
no-cache
byno-store
would preventbfcache
to kick in from any browser and could be considered as a more secure default.More information can be found here: https://www.keycdn.com/blog/http-cache-headers#no-cache-and-no-store
The purpose of this PR is to start the discussion rather than bringing a definite solution.