<p>How can I convince Firefox (3.0.1, if it matters) to send an If-Modified-Since header in an HTTPS request?  It sends the header if the request uses plain HTTP and my server dutifully honors it.  But when I request the same resource from the same server using HTTPS instead (i.e., simply changing the http:// in the URL to https://) then Firefox does not send an If-Modified-Since header at all.  Is this behavior mandated by the SSL spec or something?</p>

<p>Here are some example HTTP and HTTPS request/response pairs, pulled using the Live HTTP Headers Firefox extension, with some differences in bold:</p>

<p>HTTP request/response:</p>

<pre>http://myserver.com:30000/scripts/site.js

GET /scripts/site.js HTTP/1.1
Host: myserver.com:30000
User-Agent: Mozilla/5.0 (...) Gecko/2008070206 Firefox/3.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
<b>If-Modified-Since: Tue, 19 Aug 2008 15:57:30 GMT
If-None-Match: "a0501d1-300a-454d22526ae80"-gzip
Cache-Control: max-age=0</b>

HTTP/1.x 304 Not Modified
Date: Tue, 19 Aug 2008 15:59:23 GMT
Server: Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.8
Connection: Keep-Alive
Keep-Alive: timeout=5, max=99
Etag: "a0501d1-300a-454d22526ae80"-gzip
</pre>

<p>HTTPS request/response:</p>

<pre>https://myserver.com:30001/scripts/site.js

GET /scripts/site.js HTTP/1.1
Host: myserver.com:30001
User-Agent: Mozilla/5.0 (...) Gecko/2008070206 Firefox/3.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive

HTTP/1.x 200 OK
Date: Tue, 19 Aug 2008 16:00:14 GMT
Server: Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.8
Last-Modified: Tue, 19 Aug 2008 15:57:30 GMT
Etag: "a0501d1-300a-454d22526ae80"-gzip
Accept-Ranges: bytes
Content-Encoding: gzip
Content-Length: 3766
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/javascript</pre>

<p>UPDATE: Setting <code>browser.cache.disk_cache_ssl</code> to true did the trick (which is odd because, as Nickolay points out, there's still the memory cache).  Adding a "Cache-control: public" header to the response also worked.  Thanks!</p>

[{'answer_id': 16490, 'author': 'Nick Berardi', 'author_id': 17, 'author_profile': 'https://Stackoverflow.com/users/17', 'pm_score': 2, 'selected': False, 'text': "<p>HTTPS requests are not cached so sending an <strong>If-Modified-Since</strong> doesn't make any sense.  The not caching is a security precaution.</p>\n"}, {'answer_id': 16534, 'author': 'Nickolay', 'author_id': 1026, 'author_profile': 'https://Stackoverflow.com/users/1026', 'pm_score': 5, 'selected': True, 'text': '<blockquote>\n  <p>HTTPS requests are not cached so sending an If-Modified-Since doesn\'t make any sense. The not caching is a security precaution.</p>\n</blockquote>\n\n<p>The not caching <strong>on disk</strong> is a security pre-caution, but it seems it indeed affects the <strong>If-Modified-Since</strong> behavior (glancing over the code).</p>\n\n<p>Try setting the Firefox preference (in about:config) <strong>browser.cache.disk_cache_ssl</strong> to <strong>true</strong>. If that helps, try sending <strong>Cache-Control: public</strong> header in your response.</p>\n\n<hr>\n\n<p><strong>UPDATE:</strong> Firefox behavior <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=531801" rel="noreferrer">was changed</a> for Gecko 2.0 (Firefox 4) -- HTTPS content is now cached.</p>\n'}]
['https://Stackoverflow.com/questions/16483', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/164/']