Mike Alsup wrote on 11/21/2008 7:27 PM: > "Responses to this method are not cacheable, unless the response > includes appropriate Cache-Control or Expires header fields. What are > your response headers?
Hmmm. I created a new demo that uses $.ajax and includes both GET and POST: http://www.corry.biz/cachetest/ For POST, Firefox 3 does send the following two headers: Pragma: no-cache Cache-Control: no-cache And you can't override it in FireFox with SetRequestHeader(). This is interesting because the XHR spec says the browser shouldn't auto-send those headers, and it should allow our script to override those values: ----- If the user agent implements a HTTP cache it should respect Cache-Control request headers set by the script (e.g., Cache-Control: no-cache bypasses the cache). It must not send Cache-Control or Pragma request headers automatically unless the user explicitly requests such behavior (e.g., by (force-)reloading the page). http://www.w3.org/TR/XMLHttpRequest/#send ----- Beyond that, my server ignores those request headers and sends new data every time the browser asks for it. And as you can see in the cache tests, Firefox refuses to cache a POST, even when it receives headers directing it to cache the page contents (the same headers work successfully with GET). In contrast, Internet Explorer 7 by default caches everything unless you tell it not to with response headers (or a random URL token). It behaves identically for both GET and POST. - Bil