Apache configure static cache
Once configured, visitors can apply for cache to speed up the time for re-access. The configuration code is as follows:
Vim / usr/local/apache2/conf/extra/httpd-vhosts.conf
The following information is added to the module:
ExpiresActive on
ExpiresByType p_w_picpath/gif "access plus 1 days"
ExpiresByType p_w_picpath/jpeg "access plus 24 hours"
ExpiresByType p_w_picpath/png "access plus 24 hours"
ExpiresByType text/css "now plus 2 hours"
ExpiresByType application/x-javascript "now plus 2 hours"
ExpiresByType application/x-shockwave-flash "now plus 2 hours"
ExpiresDefault "now plus 0 min"
Save exit
Apachectl-t
Apachectl graceful
Test the configuration:
Curl-x127.0.0.1 purl 80 'https://cache.yisu.com/upload/information/20200311/71/163145.jpg'-I