Advantages of using apache mod_expires to cache static files:
Using static file caching can improve server performance, with the following benefits:
1. Shorten service response time
2. Reduce server burden
3. reduce network bandwidth usage
Program Correction Method
The name is also changed each time you change static content (css, js, etc.
Append the version number or Build number.
<Link href = "/html/std.css? V = 2.5.3.text "rel =" stylesheet "type =" text/css ">
<Link rel = "stylesheet" type = "text/css" href = "html/std.css? _V2017804120090827100441.css "/>
The CSS file on the server is still named std.css. You need to add the version number to the html page.
After the version number is added, the modified page is displayed every time you update css or js without pressing CTRL + F5 to refresh the page.
ApacheCorrection Method:
Add -- enable-expires in the Configure step when installing apache.
After installation, mod_expires.so will be displayed in the modules directory of the apache installation directory.
At the same time, it will be automatically added in Httpd. conf
LoadModule expires_module modules/mod_expires.so
Httpd. confConfiguration
ExpiresActive on
# Cache for 3 days.
ExpiresBytype text/css "access plus 3 days
ExpiresByType application/x-javascript "access plus 3 days"
ExpiresByType image/jpeg "access plus 3 days"
Expiresbytype image/gif "access plus 3 days"