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

Allow configuration of cache-control header (s3/digital ocean) #11

Closed
joeldenning opened this issue Jun 6, 2019 · 5 comments
Closed

Comments

@joeldenning
Copy link
Member

See related openmrs/openmrs-esm-root-config#5.

Browsers sometimes willfully disobey cache-control max-age=0. So either changing the default to 10 seconds or at least making it configurable within config.json would let users try to work around the browser's behavior.

@nhumrich
Copy link
Contributor

nhumrich commented Jun 6, 2019

just cause I am curious, is this all browsers? or just firefox? I get a 404 at that specific site, but I can't reproduce with latest firefox on canopy's file.

@nhumrich
Copy link
Contributor

nhumrich commented Jun 6, 2019

We could also try Cache-Control: no-cache, but it has minor performance impacts for CDN's

@joeldenning
Copy link
Member Author

You get a 404 for https://openmrs-spa.org/import-map.json? I get a json file.

@jonathandick was the one who experienced the problem. It appeared (although we're not 100% sure) that he was getting an old version of the importmap.

just cause I am curious, is this all browsers? or just firefox?

both Firefox and Chrome. If you uncheck the Disable Cache checkbox in the devtools, you stop getting the Cache-Control header. I think that means that the browser is caching the file even though the server says not to? Not 100% sure if I'm interpreting the devtools correctly. Either way, the original problem that caused this github issue is that it seemed like Jonathan was getting an old version of the import map. It could be related to Digital Ocean Spaces, instead of import-map-deployer, but I'm trying to figure out root cause.

@nhumrich
Copy link
Contributor

nhumrich commented Jun 6, 2019

ok, that url works now. Not sure why it wasn't before.

Anyways, firefox is actually working correctly:

Selection_054

it shows "cached", but you can also see the latency and header field that is because it is sending the "validate" request. The cache-control "must-revalidate", means that the browser first checks to see if the version they have is the same. If its not the same, then it gets the whole file. Its a performance optimization.
You can see that firefox also sends the If-Modified-Since: header

@joeldenning
Copy link
Member Author

interesting. So I guess we'll just chalk the issue jonathan saw yesterday up to something we don't fully understand and can't reproduce :)

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

No branches or pull requests

2 participants