Im currently using the ob_start("gz_handler"); to gzip all the contents in my php file. I am also using my .htaccess file to set the expires headers and to check whether the content has been modified or not.
I was wondering considering that i might want to make changes to the design in the future that i split the page into 3 different files, header.php content_name.php and footer.php, this would allow me to edit one file instead of having to keep making the same changes to each individual page if i was to keep them all as one.
Would this have any problems on caching if i included the files via a php include.
Code:
PHP Code:
<?php ob_start("gz_handler"); include("header.php"); includer("content_name.php"); include("footer.php"); ?>
.HTACCESS Code:
Code:
<IfModule mod_headers.c>
# Turn on Expires and set default expires to 3 days
ExpiresActive On
ExpiresDefault A259200
# Set up caching on media files for 1 month
<FilesMatch "\.(ico|gif|jpg|jpeg|png|flv|pdf|swf|mov|mp3|wmv|ppt)$">
ExpiresDefault A2419200
Header append Cache-Control "public"
</FilesMatch>
# Set up 2 Hour caching on commonly updated files
<FilesMatch "\.(xml|txt|html|js|css)$">
ExpiresDefault A7200
Header append Cache-Control "private, must-revalidate"
</FilesMatch>
# Force no caching for dynamic files
<FilesMatch "\.(php|cgi|pl|htm)$">
ExpiresDefault A0
Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"
Header set Pragma "no-cache"
</FilesMatch>
</IfModule>
|