Skip to content

Instantly share code, notes, and snippets.

@yalla
Created August 27, 2011 11:38
Show Gist options
  • Save yalla/1175283 to your computer and use it in GitHub Desktop.
Save yalla/1175283 to your computer and use it in GitHub Desktop.
Basic memory caching for CGI-scripts in Apache2
# Load modules
LoadModule cache_module modules/mod_cache.so
LoadModule mem_cache_module modules/mod_mem_cache.so
# Enable caching for only this script
CacheEnable mem /cgi-bin/bla/myscript
# Ignore the user's request for non-cached content
CacheIgnoreCacheControl On
# Ignore the fact that the cgi-script doesn't give the last modified header
CacheIgnoreNoLastMod On
# Cache for 5 seconds
CacheDefaultExpire 5
# Some defaults stolen from the howto
MCacheSize 4096
MCacheMaxObjectCount 100
MCacheMinObjectSize 1
MCacheMaxObjectSize 2048
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment