How to set your cache?
- Don’t want the broswer keep cache
Solution in StackOverflow Example:
but in Oracle WebCenter Interaction Web Service Development Guide it says:
Note: Never use Expires = 0 to prevent caching. The Expires header is sent by the remote server and passed through to the browser by the Portal Server. Unless the time on all three machines is synchronized, an Expires=0 header can mistakenly return cached content. To solve this problem, set the Expires header to a fixed date that is definitely in the past.*
- To understand cache
Also notice the difference between the “Back” buttons, history lists and caches
History mechanisms and caches are different. In particular history mechanisms SHOULD NOT try to show a semantically transparent view of the current state of a resource. Rather, a history mechanism is meant to show exactly what the user saw at the time when the resource was retrieved.
By default, an expiration time does not apply to history mechanisms. If the entity is still in storage, a history mechanism SHOULD display it even if the entity has expired, unless the user has specifically configured the agent to refresh expired history documents.
This is not to be construed to prohibit the history mechanism from telling the user that a view might be stale.
To further research on how cache works read this doc written from Mark Nottingham about Caching Tutorial for Web Authors and Webmasters