Static Caching: The user accesses a site, most of the elements are pictures, JS, CSS, these files will be cached by the client's browser to the local computer, speed up the user experience, but has a certain timeliness. Mode 1,Mod_expiresModule Implementation<ifmodule mod_expires.c> expiresactive on Expiresbytype image/gif "Access plus 1 days" expiresb YType image/jpeg "Access plus hours" expiresbytype image/png "Access plus hours" Expiresbytype text/cs S "Now plus 2 hour" Expiresbytype Application/x-javascript "now plus 2 hours" Expiresbytype Application/java Script ' now plus 2 hours ' expiresbytype application/x-shockwave-flash ' now plus 2 hours ' expiresdefault ' now Plus 0 min "</IfModule>
Mode 2, Mod_headers module realization <ifmodule mod_headers.c> # File cache for Htm,html,txt class one hours <filesmatch "\. (html|htm|txt) $ "> header Set Cache-control "max-age=3600" </filesmatch>
# CSS, JS, SWF class file cache for one weeks <filesmatch "\. (css|js|swf) $ "> Header set Cache-control "max-age=604800" </filesmatch>
# jpg,gif,jpeg,png,ico,flv,pdf file cache for one year <filesmatch "\. (ico|gif|jpg|jpeg|png|flv|pdf) $ "> Header set Cache-control "max-age=29030400" </filesmatch></ifmodule>
From for notes (Wiz)
Static cache of HTTPD