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

Closed
nzaillian opened this Issue Jun 20, 2012 · 4 comments

Comments

Projects
None yet
3 participants
@nzaillian

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"

  1. load page in browser

  2. change contents of one of the asset files you included

  3. 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.

@nzaillian

This comment has been minimized.

Show comment Hide comment
@nzaillian

nzaillian Jun 20, 2012

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.

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.

@ghost ghost assigned guilleiguaran Sep 14, 2012

@guilleiguaran

This comment has been minimized.

Show comment Hide comment
@guilleiguaran

guilleiguaran Oct 7, 2012

Member

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

Member

guilleiguaran commented Oct 7, 2012

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

@josh

This comment has been minimized.

Show comment Hide comment
@josh

josh Oct 15, 2012

Member

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

Member

josh commented Oct 15, 2012

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

@josh

This comment has been minimized.

Show comment Hide comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment