Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Etags and last-modified over https SSL?

Is it possible to use HTTP caching for conditional GET requests over a secure HTTPS connection? I've got caching working over non-secure HTTP, but when I switch to HTTPS the browser stops sending if-none-match and if-modified-since headers, so the caching breaks. I've tried various Cache-Control settings like public, max-age=3600 and whatnot, no dice.

This happens in both Safari and Chrome, so I'm assuming the SSL is breaking it somehow. Is caching not allowed over SSL?

And just to be clear, the server is indeed properly setting the etag and last-modified headers, but the browser is not sending if-none-match and if-modified-since in the request, according to the Chrome developer tools.

Thanks for your help.

like image 544
Philip Brocoum Avatar asked Sep 30 '13 18:09

Philip Brocoum


1 Answers

Figured it out! Turns out you have to have a trusted certificate. I was using my self-signed test certificate for SSL HTTPS. Adding it to my keychain and turning it green made the caching work.

like image 121
Philip Brocoum Avatar answered Oct 16 '22 14:10

Philip Brocoum