Convencer a Firefox para que envíe un encabezado If-Modified-Since a través de HTTPS
¿Cómo puedo convencer a Firefox (3.0.1, si es importante) para que envíe un encabezado If-Modified-Since en una solicitud HTTPS? Envía el encabezado si la solicitud utiliza HTTP sin formato y mi servidor lo respeta debidamente. Pero cuando solicito el mismo recurso del mismo servidor usando HTTPS (es decir, simplemente cambiando http: // en la URL a https: //), Firefox no envía un encabezado If-Modified-Since. ¿Es este comportamiento mandado por la especificación SSL o algo?
Aquí hay algunos ejemplos de pares de solicitud / respuesta HTTP y HTTPS, extraídos con la extensión de Live HTTP Headers Firefox, con algunas diferencias en negrita:
Solicitud / respuesta HTTP:
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 If-Modified-Since: Tue, 19 Aug 2008 15:57:30 GMT If-None-Match: "a0501d1-300a-454d22526ae80"-gzip Cache-Control: max-age=0 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
Solicitud / respuesta HTTPS:
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
Ajuste de actualizaciónbrowser.cache.disk_cache_ssl
a true hizo el truco (lo cual es extraño porque, como señala Nickolay, todavía hay memoria caché). La adición de un encabezado "Cache-control: public" a la respuesta también funcionó. ¡Gracias!