user1198582
user1198582

Reputation:

Is there a way to force the browser to not cache?

That's pretty much it. The problem I am having depends on if a browser is caching or not. I need to force the browser to not cache.

Upvotes: 2

Views: 195

Answers (2)

472084
472084

Reputation: 17894

You can set the following headers:

  • Cache-Control: no-cache, must-revalidate
  • Expires: Sat, 26 Jul 1997 05:00:00 GMT

The second can be any date in the past.

Edit: To do this in Yesod, have a look here: http://hackage.haskell.org/packages/archive/yesod-core/0.9.3.3/doc/html/Yesod-Handler.html#g:8

Upvotes: 0

max
max

Reputation: 851

alreadyExpired

Yesod Haddock Docs

Also, if you have control over the request (like an AJAX call) you can just add a random get param like ?sdasd=klfjlwkfj to be absolutely sure but I think that may be considered poor form.

Upvotes: 1

Related Questions