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

Improve caching a bit more #325

Open
marcoscaceres opened this issue Jan 17, 2017 · 4 comments
Open

Improve caching a bit more #325

marcoscaceres opened this issue Jan 17, 2017 · 4 comments

Comments

@marcoscaceres
Copy link
Collaborator

Emailed with mnot briefly, he suggested:

"You can drop Expires and just do CC: max-age."

I'm wondering if we could play with extending the cache duration for up to a week? If it's still going to revalidate against the hashed content (via etag), then it should be fairly safe to extend to a week.

Anyone have opinions?

@tobie
Copy link
Owner

tobie commented Jan 18, 2017

Can you explain what that would change?

@darobin
Copy link
Collaborator

darobin commented Jan 18, 2017

Sending both Expires and Cache-Control: max-age shouldn't be necessary unless you intend to target old HTTP/1.0 clients. You can drop the former.

My understanding is that if you have an ETag then you can use expiration dates farther in the future, because the client will use If-Match to which you can respond with a 304, whereas after the expiration time it will make an unconditional request (disclaimer: I'm no expert on this, it's just my understanding). Obviously this is only useful if you handle the conditions.

@tobie
Copy link
Owner

tobie commented Jan 18, 2017

Oh, so we hit the server everytime no matter what?

@darobin
Copy link
Collaborator

darobin commented Jan 27, 2017

You're probably not going to hit the server every time. But sometimes you are. The behaviour on reload for instance (and spec dev is all about the reloads) is browser-dependent. You're going to get If-Match requests after the cache expiration time too; it's not a bad idea to honour them if it's cheap enough for you.

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

3 participants