沃梦达 / 编程问答 / php问题 / 正文

让清漆在 Magento 上工作

Getting Varnish To Work on Magento(让清漆在 Magento 上工作)

本文介绍了让清漆在 Magento 上工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先请原谅我对Varnish完全缺乏了解.这是我第一次使用 Varnish 做任何事情.

First please forgive me for total lack of understanding of Varnish. This is my first go at doing anything with Varnish.

我正在关注以下示例:http://www.kalenyuk.com.ua/magento-performance-optimization-with-varnish-cache-47.html

但是,当我安装并运行它时,Varnish 似乎没有缓存.我确实得到了带有单个数字的 X-Varnish 标头和一个值为 1.1 清漆的 Via 标头

However when I install and run this, Varnish does not seem to cache. I do get the X-Varnish header with a single number and a Via header that has a value of 1.1 varnish

我被告知(我的 ISP)这是因为 Magento 设置了以下 cookie:

I have been told (by my ISP) it is because of the following cookie that Magento sets:

Set-Cookie: frontend=6t2d2q73rv9s1kddu8ehh8hvl6;到期=周四,2011 年 2 月 17 日 14:29:19 GMT;路径=/;域=XX.X.XX.XX;httponly

他们说我要么必须改变 Magento 来处理这个问题,要么配置 Varnish 来处理这个问题.由于更改 Magento 是不可能的,我想知道是否有人可以给我一个关于如何配置 Varnish 来处理这个 cookie 的线索?

They said that I either have to change Magento to handle this or configure Varnish to handle this. Since changing Magento is out of the question, I was wondering if someone can give me a clue as to how I would configure Varnish to handle this cookie?

推荐答案

http://moprea.ro/2011/may/6/magento-performance-optimization-varnish-cache-3/ 描述了使用 varnish 启用整页缓存的 Magento 扩展.此扩展依赖于 github 上发布的 Varnish 配置.

http://moprea.ro/2011/may/6/magento-performance-optimization-varnish-cache-3/ describes the Magento extension that enables full page cache with varnish. This extension relies on Varnish config published on github.

这些是已经实现的功能:

These are the features already implemented:

  1. 可行的清漆配置
  2. 使用 Varnish(一种超快速缓存 HTTP 反向代理)启用整页缓存.
  3. Varnish 服务器可在 Admin 中的 System/Configuration/General - Varnish Options 下进行配置
  4. 在保存产品、类别和 CMS 页面时自动清除(仅)缓存的页面.
  5. 在 Magento Admin 中的系统/缓存管理下添加新的缓存类型,并提供停用缓存和刷新缓存的可能性.
  6. 在保存类别导航并且需要刷新 Varnish 缓存时通知管理员用户,以便为所有页面更新菜单.
  7. 为购物车中有产品或已登录等的用户自动关闭清漆缓存.
  8. 提供默认清漆配置,以便模块可用.屏幕截图:https://github.com/madalinoprea/magneto-varnish/wiki

这篇关于让清漆在 Magento 上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:让清漆在 Magento 上工作

基础教程推荐