【问题标题】:Output caching in IIS doesn't work for Wordpress php filesIIS 中的输出缓存不适用于 Wordpress php 文件
【发布时间】:2013-04-12 21:03:10
【问题描述】:

我为 php 文件启用了输出缓存

<configuration>
   <system.webServer>
      <serverRuntime frequentHitThreshold="1" frequentHitTimePeriod="00:00:30" />
      <caching>
         <profiles>
           <add extension="*.php" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="00:00:59" location="Any" varyByQueryString="*" />
         </profiles>
      </caching>
   </system.webServer>
</configuration>

缓存适用于打印时间的 PHP 测试文件

http://www.ahangbaz.com/time.php

但它不适用于 wordpress(日期打印在第 3 行的页面上)

http://www.ahangbaz.com/index.php/4002/omega-el-producto/

我没有在 wordpress 中使用任何插件。

【问题讨论】:

    标签: wordpress caching iis outputcache


    【解决方案1】:

    我对为什么第二个链接没有被缓存的猜测是该链接没有在php结束

    如果您使用* 扩展名,您的运气可能会更好。但是,这可能会缓存一些您不打算缓存的内容。

    另一种选择是使用 Wordpress 插件,例如 W3 Total Cache。不过我个人没有用过。

    另见:Speed Up Wordpress On IIS 7

    【讨论】:

    • 带 * 的效果也不好。我什至尝试使用“index.php?id=4002”的 Wordpress PermaLink 格式但没有用
    • 同样的问题。 appiclationhost 配置(根级别)-->frequentHitThreshold 和-->frequentHitTimePeriod 下有一个阈值但即使调整到超低阈值(1)和高时间(5 分钟),它仍然会旋转php fast-cgi 进程。我会继续研究,如果我发现任何东西都会回复..
    • docs.microsoft.com/en-us/windows-server/administration/… 看起来它需要您启用注册表中的设置。将这些注册表值强制转换为 HTTP 服务参数并重新启动 WWW 服务后可以确认功能正常。此答案中描述的缓存配置文件的 * 扩展名是 100% 正确的。实际上,您不应该缓存所有内容,但必须缓存无扩展名的 wordpress。推荐使用位置衍生工具(不包括 wp-admin)。
    猜你喜欢
    • 2010-11-12
    • 1970-01-01
    • 1970-01-01
    • 2013-10-08
    • 1970-01-01
    • 2016-05-26
    • 1970-01-01
    • 2012-12-25
    • 2012-07-23
    相关资源
    最近更新 更多