我有一个网站WeeTech 解决方案。每当我在“<strong>GT Matrix”上查看我的网站时,都会向我显示问题的数量,例如... • https://www.weetechsolution.com/css/content_slider_style.css(未指定到期时间)
如何解决这个问题?
我有一个网站WeeTech 解决方案。每当我在“<strong>GT Matrix”上查看我的网站时,都会向我显示问题的数量,例如... • https://www.weetechsolution.com/css/content_slider_style.css(未指定到期时间)
如何解决这个问题?
如果您的网站是 html 和 php,那么您可以使用带有以下代码的 .htaccess 文件并将此.htaccess
文件上传到主根目录。
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
如果您的网站在 .Net 中,那么您可以使用下面给出的staticContent
内部Web.config
文件代码
<staticContent>
<clientCache cacheControlCustom="public" cacheControlMaxAge="24:00:00" cacheControlMode="UseMaxAge" />
</staticContent>
您必须将此代码添加到您的 htaccess 文件中。
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>