On 10/10/05, Michael Schuerig
<michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org>
wrote:>
> Is it even possible to force a page to be requested again when the user
> goes back using the back button? Rails already sets a Cache-Control:
> no-cache header, I''ve added an Expires header. Both to no avail.
> Firefox as well as Konqueror just go back to their stored page without
> a new request.
>
> Michael
Javascript? Here''s a bit from Eric Costello talking about how Flickr
deals with that issue:
http://www.ajaxian.com/archives/2005/05/ajax_summit_eri.html
Getting around the browser cache problem
When change anything on a Flickr page with Ajax, it sets a cookie, and
the cookie is set to a timestamp that is inserted into the JS when the
page loads. Whenever the page is reloaded (e.g. from cache), and if
the cookie value is the same, then a change has happened, and I
callback to get the new information.
So in the new Flickr, you can BACK and FORWARD all day, and the
original title doesn''t come back to haunt you. Nice hack Eric!
Waiting until onLoad()
Eric talks about how he has found putting code in onLoad() is too
late. You can be waiting until images are loaded etc. So, he uses a
pattern of putting <script> after elements that he needs to work with.
--
rick
http://techno-weenie.net