What “Apache cache” can mean
Apache itself does not have a single button. Caching usually comes from mod_cache with mod_cache_disk (files under a CacheRoot) or mod_cache_socache (shared memory / memcached backends). Separate layers—PHP OPcache, FastCGI app caches, reverse proxies in front of httpd, and browser/CDN caches—are not cleared by trimming mod_cache alone.
Disk cache (mod_cache_disk)
Identify CacheRoot and structure from your config (CacheDirLevels / CacheDirLength). Prefer htcacheclean to enforce maximum disk/inode usage rather than rm -rf on the whole tree during traffic—deleting files an active worker still maps can cause errors. Run apachectl configtest before reloads.
| Step | Action | Watch for |
|---|---|---|
| Measure | du -sh / df -i on CacheRoot | Inode exhaustion before bytes |
| Trim | htcacheclean daemon or cron with limits | Path must match vhost cache config |
| Reload | apachectl graceful / systemctl reload httpd | In-flight downloads; RAM caches drop on child recycle |
Shared-object cache (mod_cache_socache)
Entries live in the configured socache provider (for example shmcb paths or memcached). Clearing often means restarting the provider, flushing the remote store, or shortening TTLs—consult the provider docs. Do not assume on-disk paths cover socache RAM.
After you clear
Expect an origin load spike as misses refetch. Pre-warm critical URLs from a canary or load test account. If HTML is correct but assets look old, purge nginx edge cache or CDN separately.
Related: Apache performance tuning, Apache configuration explained, Common Apache errors.