Mod_expires:
http://httpd.apache.org/docs/mod/mod_expires.htmlMod_headers:
http://httpd.apache.org/docs/mod/mod_headers.htmlYou're going to need to compile and install the modules. Look at my available modules (I'm 4.1.2) using phpinfo(); ?> I see that I do have mod_expires installed, and this is a module I did not install myself.
"mod_ssl, mod_php4, mod_bandwidth, mod_gzip, mod_setenvif, mod_so, mod_usertrack, mod_headers, mod_expires, mod_digest, mod_auth_external, mod_auth_db, mod_auth_anon, mod_auth, mod_access, mod_rewrite, mod_alias, mod_proxy, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_info, mod_status, mod_negotiation, mod_mime, mod_log_referer, mod_log_agent, mod_log_config, mod_env, http_core"
mod_expires may do what you need it to, you may not need to install mod_headers. In the mod_expires documentation it lists specific expiry commands to affect .gif images, you could use the below command to expire after access.
ExpiresByType image/gif "access plus 5 seconds"
This would expire type .GIF after 5 seconds have passed after access.
These rules must be added to /etc/httpd/conf/httpd.conf
I assume you want to do this for all sites, so you could do a "server config" context.
Follow these steps to implement mod_expires on a global scale, for all vhosts.
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
pico -w /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/45Mod_Expires
[Add the following lines]
# Mod_expires configuration
# Expire documents by type or access
ExpiresActive on
ExpiresDefault "access plus 12 hours"
ExpiresByType image/gif "access plus 5 seconds"
ExpiresByType image/html "access plus 5 minutes"
[Save changes]
/sbin/e-smith/expand-template /etc/rc.d/init.d/httpd restart
/etc/rc.d/init.d/httpd restart
You should now be expiring documents based on the above rules. For more information and the configuration of Mod_expires please reference the above URL.
Hope this helped,
Nathan