How Do I Cache Just the Homepage with Apache .htaccess?

Posted by Volomike on Server Fault See other posts from Server Fault or by Volomike
Published on 2010-03-04T02:49:18Z Indexed on 2010/04/10 7:03 UTC
Read the original article Hit count: 529

Filed under:
|
|
|

This config is close...

<FilesMatch "\.(php)$">
Header set Cache-Control "max-age=7200, must-revalidate"
</FilesMatch>

...but it does all php pages, not just the home page like I want.

Basically the developer said he wants example.com to be cached, while:

http://example.com/electronics/

would not be cached.

Note the developer is using pretty URLs with an MVC framework that runs everything through index.php.

© Server Fault or respective owner

Related posts about apache

Related posts about apache2