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

Add cache buster to images as well #81

Closed
LukasReschke opened this issue Jun 13, 2016 · 5 comments
Closed

Add cache buster to images as well #81

LukasReschke opened this issue Jun 13, 2016 · 5 comments
Assignees
Labels

Comments

@LukasReschke
Copy link
Member

We should also add cache busters to images such as our SVG files as well. For example by including core/img/filetypes/folder-shared.svg?version=9.0.0. Otherwise after an update still the old images are shown until the user manually clears their cache.

@LukasReschke LukasReschke added this to the Nextcloud 10 milestone Jun 13, 2016
@LukasReschke
Copy link
Member Author

FYI @jancborchardt, just experienced this when I migrated https://cloud.nextcloud.com/

@LukasReschke
Copy link
Member Author

I wonder if we can easily do this via some Javascript: Parse for all image links in core/ and append a ?version=. Mhm…

@LukasReschke
Copy link
Member Author

Something like http://www.bennadel.com/blog/2643-cache-busting-css-images-with-less-css.htm would really help. Using http://lesscss.org/#client-side-usage we could also do this so that developers don't need any additional tools and do the compilation as packaging step.

@LukasReschke
Copy link
Member Author

Assigning @jancborchardt, either cough cough somebody cough cough needs to add the version strings manually to all images in the CSS files and change them all the time we change an image…

Or we switch to something like LessCSS that does this for free.

@ChristophWurst
Copy link
Member

I wonder if we can easily do this via some Javascript: Parse for all image links in core/ and append a ?version=. Mhm…

I assume that might cause the browser to download the images twice. First, the HTML/CSS is parsed and the browser starts downloading files without any cache buster (the original URL). At some point the JS kicks in and modifies all core image URLs. As the browser might already download some images, those are downloaded a second time as the URL changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants