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

Implement Cache-Control: immutable #7224

Closed
mfr-itr opened this issue Nov 20, 2017 · 4 comments
Closed

Implement Cache-Control: immutable #7224

mfr-itr opened this issue Nov 20, 2017 · 4 comments
Assignees
Projects
Milestone

Comments

@mfr-itr
Copy link

mfr-itr commented Nov 20, 2017

Steps to reproduce

  1. Reload a nextcloud page, for example the Files app

Expected behaviour

The js and css files have a file hash in the URL, for example /css/core/eb4f51d7ec0ed68ba27ebcd1548755aa-server.css?v=a08c1ea900eef4f5e2c1cd1fd55d4117-0. The browser shouldn't have to validate its cache since the file will never change.

Actual behaviour

The browser issues a request, with a 304 response from the server

Solution

Implement the Cache-Control: immutable Cache-Control extension.

Server configuration

Nextcloud version: (see Nextcloud admin page)
12.0.3

Client configuration

Browser: Firefox 57

Operating system: Archlinux

It could also help with #2272.

@rullzer rullzer self-assigned this Nov 20, 2017
@rullzer rullzer added this to the Nextcloud 14 milestone Nov 20, 2017
@rullzer
Copy link
Member

rullzer commented Nov 20, 2017

I'll look into this for NC14. We have to make sure it also still works in development so that the hash changes often enough (or just not be immutable when we are in debug mode?)

@rullzer rullzer added this to NC14 in Performance Nov 20, 2017
@mfr-itr
Copy link
Author

mfr-itr commented Nov 20, 2017

Yes, it should only be on release mode.

@Yamakaky
Copy link

In fact, it shouldn't change anything since the hash in the file name changes after each modification. The link in the HTML will change, referencing the new file.
immutable should of course only be enabled for files with a hash in the file name, of course.

@mfr-itr
Copy link
Author

mfr-itr commented Mar 21, 2018

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Performance
  
NC14
Development

No branches or pull requests

3 participants