Sign up ×
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:

    DocumentRoot /var/www/
    SetOutputFilter INFLATE;proxy-html;DEFLATE
    CacheEnable mem
        MCacheSize 4096
        MCacheMaxObjectCount 1000
        MCacheMaxObjectSize 2048
    CacheDefaultExpire 3600
        CacheMaxExpire 3600
        CacheStoreNoStore On
        CacheStorePrivate On
        CacheIgnoreCacheControl On
        CacheIgnoreNoLastMod On
        MCacheMaxStreamingBuffer 2097152

this page 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.


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.

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

Your Answer


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.