Quote:
Originally Posted by vlad59
In theory there nothing to add in Apache config if your library is outside your web directory. Thoses lines in fetch.php tell the browser to keep the images 14 days :
Code:
$expires = 60*60*24*14;
header("Pragma: public");
header("Cache-Control: maxage=".$expires);
header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT');
|
For the intrepid people who are like me running
Apache and want to try for themselves. I "removed" the code from fetch.php (this code cannot work in Apache afaik) and added the following to the .htaccess file: (do not forget to enable [headers_module] in apache)
Code:
## Cache
<ifModule mod_headers.c>
Header unset Pragma
# remove and disable ETag
Header unset ETag
FileETag None
# remove Last-Modified
Header unset Last-Modified
# cache images for 10 days
<FilesMatch "\.(jpg|ico|jpeg|png|gif)$">
Header set Cache-Control "max-age=864000, public, must-revalidate"
</FilesMatch>
# cache epub/opf/pdf docs for 10 days
<FilesMatch "\.(epub|mobi|opf|pdf)$">
Header set Cache-Control "max-age=864000, public, must-revalidate"
</FilesMatch>
# cache html/htm/xml/txt diles for 2 days
<FilesMatch "\.(html|htm|xml|txt|xsl)$">
Header set Cache-Control "max-age=7200, must-revalidate"
</FilesMatch>
</ifModule>
However

it did not really work for me as I have my data outside of my web directory

.
I may have to rethink my storage strategy. More

required.
Anyone with a brilliant idea to make this work?