Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have this set up in my 000-default:

<VirtualHost 192.168.1.10:80>
    ServerName live.website.com
    DocumentRoot /var/www/live.website.com
    SetOutputFilter INFLATE;proxy-html;DEFLATE
    CacheEnable mem http://live.website.com/
        MCacheSize 4096
        MCacheMaxObjectCount 1000
        MCacheMaxObjectSize 2048
    CacheDefaultExpire 3600
        CacheMaxExpire 3600
        CacheStoreNoStore On
        CacheStorePrivate On
        CacheIgnoreCacheControl On
        CacheIgnoreNoLastMod On
        MCacheMaxStreamingBuffer 2097152
</VirtualHost>

this page http://live.website.com/index.php only printing : time(), but I see that after 10 seconds the time is re-cached.
Also tried disk, but I get the same results.

Ubuntu + lamp latest.

Thanks

share|improve this question

1 Answer 1

up vote 0 down vote accepted

A regular PHP script will need to include additional HTTP header information for mod_cache to work. See section "What Can be Cached?" from Apache's Caching Guide.

<?php
header("Cache-Control: must-revalidate, max-age=3600");
header("Vary: Accept-Encoding");
echo time();
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.