dtdvbf37193 2012-06-22 18:37
浏览 73
已采纳

如何配置Varnish VCL文件以缓存OSCommerce站点?

I'm building a simple server setup for developping purposes, with Nginx, PHP-FPM, APC, Varnish and MySQL, using Ubuntu Server 12.04.

But now I want to deploy at this testing environment, an OSCommerce app. After some googling I couldn't find a way to properly configure OSCommerce with Varnish.

Actually I have Varnish configured for Wordpress (varnish file and default.vcl file) like one from there (GitHub-Nicolargo) but just a little bit modded.

So, should I use the same configuration for WP? If not, There's someone who knows how (or where should I find) to configure it properly for OSCommerce?

Hugs

  • 写回答

1条回答 默认 最新

  • doupao1530 2012-06-25 07:30
    关注

    Configuring Varnish for Open Source models such as Wordpress, Joomla, Drupal or OSCommerce is tricky: you can have a default VCL that works just fine in 50% of the cases, but as soon as extra modules are activated in the CMS, the caching stops working. That's because each module can alter cookies, caching-headers, ...

    That pretty much makes each Varnish implementation a custom job: you can start from a basic VCL that works for the base CMS, but it'll require finetuning specific to that site.

    I would therefore recommend starting with a basic VCL file, such as the one you linked or that you can find here. Afterwards, it's a matter of running varnishlog/varnishhist/varnishstat to find out which pages are not getting cached, determining why (a combination of cookies/headers/invalid VCL) and modifying the appropriate VCL file(s).

    I know it's not the answer you were looking for directly, but if you could post some output of varnishlog where a request that -should- be cached is -not- being cached, we could take it from there.

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

报告相同问题?

悬赏问题

  • ¥20 求数据集和代码#有偿答复
  • ¥15 关于下拉菜单选项关联的问题
  • ¥15 如何修改pca中的feature函数
  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况