Skip to content
This repository

asset digests not updating when corresponding files changed in development mode #6803

nzaillian opened this Issue June 20, 2012 · 4 comments

3 participants

Nicholas Zaillian Guillermo Iguaran Joshua Peek
Nicholas Zaillian

I like to enable asset digests in development mode and a far future cache expiry (via the static_cache_control config variable) to browser-cache unchanged assets. In 3.2.6, the digests generated by the asset tag helpers (stylesheet_link_tag, javascript_include_tag, image path helpers) do not get updated when the corresponding files are changed locally. To reproduce:

1) in development.rb, set:

config.assets.digest = true
config.static_cache_control = "public, max-age=3600"

2) load page in browser

3) change contents of one of the asset files you included

4) reload page in browser

The browser-caching is working, but the digest for whatever file you changed will not get updated (and the browser cache won't be busted for the file so it also won't get reloaded).

I'm looking into a fix but am submitting this because I'm sure someone more acquainted with the asset pipeline can patch it quicker or point me in the right direction.

Nicholas Zaillian

one more note, if you want to reproduce this:

you should clear the tmp/cache directory after you modify the "static_cache_control" config variable. If you don't, the cache-control headers may not be updated with the new cache-control setting for any of the assets being served from the cache.

Guillermo Iguaran

This is being caused by 6fc518e, I will fix it

Joshua Peek

Definitely a bug in rails/sprockets-rails. Sprockets' index should not be coupled using config.assets.digest.

Joshua Peek josh closed this October 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.