Pregunta

I combined all my css files into a .php file to reduce the number of requests for each access to my webpage.
I set expiration date header to 1 day after request at my .php file
The problem is that the browsers don't use cache for .php files. I mean it doesn't send a IF-MODIFIED header field at request and therefore all subsequent requests will be responded with HTTP Response Code 200 (instead of 304).

¿Fue útil?

Solución

You could use mod_rewrite to set up a rewrite rule to send all requests for a "fake" css path to your php file on the server. For instance, send all requests for all.css to combine_css.php.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top