Quote:
Originally Posted by Kustom42
Try uploading this test.php file to see the results in action. It should load the page the first time with the current timestamp and it should cache that file for 300 seconds and still display the same time as long as you dont force refresh it. ctrl+f5 is a force refresh and tells the server to completely reload it, f5 is a simple refresh and will display the cached page.
PHP Code:
<?php header("Cache-Control: must-revalidate, max-age=300"); header("Vary: Accept-Encoding"); echo time()."<br>"; ?>
|
Sorry, but I don't have php installed on my system. I tried to install it, but due to some reason i was not able to properly install it. But I suppose that what you want to suggest is that I should specify the http headers some where.I saw this link:
http://betterexplained.com/articles/...-http-caching/
and so did the following:
1)uncommented LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
in the conf file.
2)added the following code in the httpd.conf file:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A0
# 1 YEAR - doesn't change often
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
ExpiresDefault A29030400
</FilesMatch>
</IfModule>
<filesMatch "\.(html|htm|js|css|pdf)$">
<ifModule mod_headers.c>
Header set Cache-Control "max-age=300"
Header set Vary "Accept-Encoding"
</ifModule>
</filesMatch>
3) Since expire and max age both are specified max age wont be considered and since expire is set to 1 year, so as i thought the pdf document should stay in cache for 1 year.
4) I restarted the server and opened the link localhost/ri/gdsf.pdf. I was again expecting that since I have set the expire header so this thing will be cached the cache root folder that I have specified. But the folder is empty means it has not cached anything.
I want to see how data being cached is stored in the cache root directory..What can I do to see it?????