最后你有expires标头。根据这篇Google Developers文章,HTTP Caching : Cache-Control标头被定义为HTTP/1.1规范的一部分,并取代了以前用于定义响应缓存策略的标头(在本例中为Expires标头)。所有现代浏览器都支持Cache-Control,因此这就是您所需要的。但是,如果您同时拥有两者,则不会有任何伤害,但请记住,只会使用一个。
这会告诉 Web 浏览器在删除网站资源之前应将其存储多长时间。 cache-control标头向 Web 浏览器提供了有关如何进行缓存的特定详细信息。 expires标头启用缓存并告诉 Web 浏览器它应该在删除特定文件之前存储多长时间。 您可以将以下代码添加到您的.htaccess文件中以添加过期标头: ## EXPIRES HEADER CACHING ## <IfModu...
cache-control标头向Web浏览器提供了有关如何进行缓存的特定详细信息。 expires标头启用缓存并告诉Web浏览器它应该在删除特定文件之前存储多长时间。 您可以将以下代码添加到您的.htaccess文件中以添加过期标头: ## EXPIRES HEADER CACHING ## <IfModulemod_expires.c> ExpiresActiveOnExpiresByType image/jpg"access 1 ...
<filesMatch "\.(js)$"> Header set Cache-Control "max-age=604800, private"</filesMatch> <filesMatch "\.(x?html?|php)$"> Header set Cache-Control "max-age=600, private, must-revalidate"</filesMatch> </ifModule> 结束Cache-Control Headers ...
location ~* \.(js|css|png|jpg|jpeg|gif|svg|ico)$ { expires 14d; add_header Cache-Control "public, no-transform";} 此代码设置缓存过期的时间。它告诉您的服务器上述文件类型在 14 天内不会更改。 如果您希望进一步加快 WordPress 的速度,请务必查看我们关于如何提高 WordPress 速度和性能的指南。
W3 Total Cache中的其他设置 对于其他设置,如“ NGINX服务器配置文件路径(NGINX server configuration file path)”、“启用文件锁定(enable file locking)”、“优化磁盘增强页面和缩小NFS磁盘缓存(optimize disk enhanced page and minify disk caching for NFS)”,我们建议将它们保留为默认设置,除非您有特定原因更改...
fastcgi_cache_valid2003013021h; #新增的缓存规则 #添加一个头部,用于判断缓存状态add_headerCache-Control1max-age=0; add_headerNginx-Cache"$upstream_cache_status"; add_headerLast-Modified$date_gmt; add_header X-Frame-OptionsSAMEORIGIN; # 只允许本站用 frame 来嵌套 add_header X-Content-Type-...
此外,您应该在htaccess文件中的Expires Headers代码下添加Cache-Control Headers,如下示例。 # TN - BEGIN Cache-Control Headers <ifModule mod_headers.c> <filesMatch "\.(ico|jpeg|jpg|png|gif|swf|pdf|svg)$"> Header set Cache-Control "public" ...
Cache-Control: no-store Cache-Control: no-transform Cache-Control: only-if-cached Note that the unit of time is configured in seconds. In our example above, the “max-age” has been set to ten minutes (or 600 seconds). If you wanted to set the expiration at four hours, you would re...
Take control of your site and manage when plugins are loaded on individual pages for your store. Smart Search AI Drive engagement and conversions with your highest-intent users with intuitive, typo-tolerant, and relevant search results. EverCache® for Woo Cache 90% more pages than default Woo...