downloadTemp2014 2014-01-19 19:18
浏览 41
已采纳

htaccess缓存和php缓存太多了

Ok, I have a little problem. I think my .htaccess caching is causing problems. I have intergrated a nice PHP Cache system on each page.

I also have included this in my .htaccess page:

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

I have a CMS installed ( not wordpress ) - and when I submit or edit a new story to the MYSQL database through my CMS, I have it clear the "cached pages".

That all works great.

However, when I go to the site after the cache has been cleared, I still need to do a hard browser refresh to see the updated and new content.

Do I get rid of the .htaccess cache code ? or what ?

Thanks for your tips.

  • 写回答

1条回答 默认 最新

  • duanlvji4780 2014-01-19 20:10
    关注

    You'll want to remove the line

    ExpiresDefault "access plus 2 days"

    It forces a browser to cache anything not explicitly listed above (like, for instance text/html) for two days, which is what is happening to your Wordpress posts.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题