I implemented this solution to prevent browser page caching based on the question How to prevent browser page caching in Rails :
def set_cache_buster response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate" response.headers["Pragma"] = "no-cache" response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT" end
Although this certainly works, it looks a bit like killing an ant sledgehammer; everything prevents caching, including images (for example, a hamburger icon or other small images). When navigating from page to page, this leads to unsightly flashes of blank content while these images reload.
Is there a way to prevent shared caching but free up certain resources?
caching ruby-on-rails
Rob ringham
source share