Вопрос

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).

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top