I'm page caching the majority of my pages and using a dynamic js file to inject the user specific content.
So in my header file I have something like this:
<%= javascript_include_tag '/dynamic_header/current' %>
What this will do is execute the dynamic_header controller show.js.erb view which gets returned alongside the page and handles the injection of the dynamic content.
All well and good until I test under safari. (Firefox works fine)
It seems safari caches this file far too heavily and doesn't notice when it changes, which is every time there is a new flash messages or when a user logs in or out.
Is there an easy way in my controller to add an expires header to this file? Or do people have any other suggestions on how to make safari notice that the cached file has changed.
Thanks.