Skip to content

Instantly share code, notes, and snippets.

@searls
Created January 18, 2012 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save searls/1636038 to your computer and use it in GitHub Desktop.
Save searls/1636038 to your computer and use it in GitHub Desktop.
Sprocket's hack to

Just take this source from sprockets' server.rb:

          if attributes_for(env["PATH_INFO"]).path_fingerprint
            headers["Cache-Control"] << ", max-age=31536000"

          # Otherwise set `must-revalidate` since the asset could be modified.
          else
            headers["Cache-Control"] << ", must-revalidate"
          end

and comment out this stuff:

          # if attributes_for(env["PATH_INFO"]).path_fingerprint
            headers["Cache-Control"] << ", max-age=31536000"

          # Otherwise set `must-revalidate` since the asset could be modified.
          # else
            # headers["Cache-Control"] << ", must-revalidate"
          # end

and once cached, Chrome starts acting like all the other browsers.

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