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

Enforce no-cache behaviour via Cache-Control header #29

Merged
merged 2 commits into from
Apr 13, 2020

Conversation

yong-jie
Copy link
Member

@yong-jie yong-jie commented Apr 13, 2020

Problem

Browsers are unnecessarily caching resources and server responses.

This results in bundle.js being momentarily outdated on new redeployments. IE's behaviour of caching responses without revalidation also creates problems because even after signing out, it still mistakenly thinks it is still logged in due to outdated auth-check responses.

Closes #4 and closes #5 .

Solution

Send Cache-Control: no-store header for every outgoing response. This is implemented using a middleware that is inserted very early in the pipeline, right before express.static is being used. This allows even bundle.js to be not be cached.

Copy link
Contributor

@liangyuanruo liangyuanruo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I confirm this has been tested on IE?

@yong-jie
Copy link
Member Author

Have confirmed that this solves the sign-out-not-working issue on IE.

@yong-jie yong-jie merged commit 24ab071 into develop Apr 13, 2020
@yong-jie yong-jie deleted the dont-use-cache branch April 13, 2020 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Landing page redirects to user page after sign out on Internet Explorer Do not cache frontend assets
2 participants