I have the following situation:
Page A: /something/new
Which posts back to: /something/create
Which redirects to Page B: /something/edit
So far it all works. Now, /something/edit is a page that lets you do a bunch of things through AJAX, so it starts up empty, and as you use it it gets "fuller", so to speak. If you reload at any time, you get everything back, rendered by the server.
However, if after being redirected, and making modifications to the page, you hit Back and then Forward again, the browser (Chrome at least) doesn't hit the server again (not even an Etag check that might result in a 304, nothing), it just loads Page B from cache, which shows up empty, and can be quite confusing...
When first rendering Page B, the server responds with the following headers:
Cache-Control:must-revalidate, private, max-age=0
Connection:Keep-Alive
Content-Length:18577
Content-Type:text/html; charset=utf-8
Date:Thu, 02 Aug 2012 20:19:59 GMT
Server:WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20)
Set-Cookie: (redacted)
X-Miniprofiler-Ids:["ma2x1rjc0kgrijiug5dj","nnmovj2wz1lux85jwhd3"]
X-Request-Id:2dd3fa62799beadc1b39b8db1aa5f45f
X-Runtime:0.245014
X-Ua-Compatible:IE=Edge
I don't see an Etag, or anything similar that could be bothering. Also, if I'm interpreting "Cache-control" correctly (i'm not very experienced with it, though), it seems to be saying to not cache, ever...
Is there any way to avoid this behaviour, and have the browser hit the server again on Back/Forward?
Thanks!
Daniel