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

Support clustered environments #50

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

pihvi
Copy link

@pihvi pihvi commented Jun 10, 2020

I run in to a "fatal" issue using staticify in clustered server setup. When rolling a new version to the cluster, different nodes can serve different versions of the application. This means one node might serve asset with hash "1a" and another might have the same asset with updated version and serving it with hash "1b". The client might get the hashed URL from new node with hash "1b", but requesting it would go to the old node having the "1a" version. Staticify will happily serve the "1a" content with the "1b" request as if it is correct version and it gets cached in reverse proxy for one year. This breaks the application quite effectively.

In this PR the hash is stored to "versions" and on request the hash is checked to match or maxAge=0 will be served to disable reverse proxy caching.

@XhmikosR
Copy link
Collaborator

I don't see how this is readable, though.

@pihvi
Copy link
Author

pihvi commented Jun 18, 2020

the code or the issue? what is unreadable?

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.

2 participants