禁用HTML内容的缓存Apache

时间:2018-10-02 14:41:25

标签: apache .htaccess caching

我的页面有问题。我在.htaccess中启用了图片,css,js,flash和gzip的缓存功能。

但是,当我在网页上添加一些新的html内容时,必须使用硬刷新(CTRL + F5)进行加载,我的html内容将被缓存。我怎么了

我的.htaccess

# enable gzip compression
<IfModule mod_deflate.c>
    <IfModule mod_filter.c>
        AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript application/json application/xml image/svg+xml
    </IfModule>
</IfModule>

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 month"
ExpiresByType image/svg+xml "access 1 month"
ExpiresByType image/jpeg "access 1 month"
ExpiresByType image/gif "access 1 month"
ExpiresByType image/png "access 1 month"
ExpiresByType text/css "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 month"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##

0 个答案:

没有答案