Apache

.htaccess文件

<filesMatch "\.(ico|gif|jpg|png|jpeg)$"> 
ExpiresActive On 
ExpiresDefault "access plus 11 month" 
Header append Cache-Control "public" 
</filesMatch>

Nginx

.conf文件

location ~* ^.+\.(jpg|jpeg|gif|png|ico)$ 
{ 
expires max; 
}

IIS

config.xml文件

<configuration> 
    <system.webServer> 
        <staticContent> 
            <clientCache cacheControlMode="UseExpires" httpExpires="Tue, 19 Jan 2038 03:14:07 GMT" /> 
        </staticContent> 
    </system.webServer> 
</configuration>
Last Updated: 11/18/2018, 8:36:18 PM