nexcess_net

Turpentine - Varnish Cache

  • Popularity Score 3997 Popularity Score

    Popularity ScoreReferrals to Site/Downloads

    0 0 1+ 1+ 250+ 250+ 1000+ 1000+ 10000+ 10000+

Simplify Varnish management and deployment with Magento.
Compatible with:
This extension is currently unavailable on Magento Connect. Please contact the developer.

You will be re-directed to the developer's website to complete your purchase.

You must be registered and logged in to get extension key.
In order to get this extension, you must be logged in to the Magento Community. Click here to login or register.
In order to get this extension, you must have active Magento Go Store. Click here to create Go store.

Magento Connect 2.0

Magento Connect 2.0

FREE
Previous Next
Overview

Turpentine - Varnish Cache

Nexcess.net Turpentine Extension for Magento

Turpentine is a full page cache extension for Magento that works with Varnish, a very fast caching reverse-proxy. By default, Varnish doesn't cache requests with cookies and Magento sends the frontend cookie with every request causing a (near) zero hit-rate for Varnish's cache. Turpentine configures Varnish to work with Magento and modifies Magento's behaviour to significantly improve the cache hit rate.

Note that while this extension is now considered stable, it is strongly recommended that it be tested on a development/staging site before deploying on a production site due to the potential need to add custom ESI policies for blocks added by other extensions.

Features

  • Full Page Caching, with hole-punching via Varnish ESI and/or AJAX, even for logged in visitors
  • Configurable via standard Magento methods (Admin system configuration and layout XML), no manual editing of Varnish config required for most cases
  • Able to generate and apply new Varnish VCLs (configurations) on the fly, without restarting/changing Varnish's config files or flushing the cache
  • Blacklist requests from caching by URL or parameters (SID, store, etc)
  • Configure cache TTL by URL and individual block's TTL
  • Supports multiple Varnish instances for clustered usage
  • Automatic cache clearing on actions (clearing product/catalog/cms page after saving)
  • Supports non-root Magento installs (i.e. putting Magento in /store/ instead of /) and multi-store/multi-site setups
  • Support for site-crawlers for cache warming, and includes a (basic) built-in site-crawler
  • SSL support through Pound or Nginx

Requirements

  • Magento Community Edition 1.6+ or Magento Enterprise Edition 1.11+
  • Varnish 2.1+ (including 3.0+)

Installation & Usage

See the Installation and Usage pages.

Support

If you have an issue, please read the FAQ then if you still need help, open a bug report in GitHub's issue tracker.

Please do not use Magento Connect's Reviews or (especially) the Q&A for support. There isn't a way for me to reply to reviews and the Q&A moderation is very slow.

Contributing

If you have a fix or feature for Turpentine, submit a pull request through GitHub to the devel branch. The master branch is only for stable releases. Please make sure the new code follows the same style and conventions as already written code.

How it works

The extension works in two parts, page caching and block (ESI/AJAX) caching. A simplified look at how they work:

For pages, Varnish first checks whether the visitor sent a frontend cookie. If they didn't, then Varnish will generate a new session token for them. The page is then served from cache (or fetched from the backend if it's not already in the cache), with any blocks with ESI polices filled in via ESI. Note that the cookie checking is bypassed for clients identified as crawlers (see the Crawler IP Addresses and Crawler User Agents settings).

For blocks, the extension listens for the core_block_abstract_to_html_before event in Magento. When this event is triggered, the extension looks at the block attached to it and if an ESI policy has been defined for the block then the block's template is replaced with a simple ESI (or AJAX) template that tells Varnish to pull the block content from a separate URL. Varnish then does another request to that URL to get the content for that block, which can be cached separately from the page and may differ between different visitors/clients.

Notes and Caveats

  • Turpentine will not help (directly) with the speed of "actions" like adding things to the cart or checking out. It only caches, so it can only speed up page load speed for site browsing. It will remove a lot of load on the backend though so for heavily loaded sites it can free up enough backend resources to have a noticeable effect on "actions".
  • There are some technical limitations when using Varnish 2.1.x: External ESI requests are not blocked, and per-block TTLs in ESI policies are not honored (all blocks use the default TTL)
  • The core parts of Turpentine (caching and ESI/AJAX injection) work under Magento CE 1.5, but a significant portion of the auxillary functionality doesn't work due to changes to event names. That said, it would be possible to use Turpentine with Magento CE 1.5 with an understanding that it is not supported and what actions need to be taken manually. Both cache flushing (both automatic an manual) and cache warming (due to missing events that trigger the cache flushing) do not work.
  • Anonymous blocks are not able to be hole-punched. For CMS pages, it is recommended that you include the block in the page's layout updates XML and give it a name, then it can have an ESI policy like normal

Known Issues

  • Logging and statistics will show all requests as coming from the same IP address (usually localhost/127.0.0.1). It should be possible to work around this using Apache's mod_remoteip or mod_rpaf.

Demo

See the Demo Sites wiki page.

If you use Turpentine (on a production site), feel free to add your site to the list!

License

The code is licensed under GPLv2+, much of the ESI-specific code is taken from Hugues Alary's Magento-Varnish extension, which is licensed as GPLv3.

Release Notes

RELEASE-0.3.0

2013-01-16 21:38:32
  • Version number: 0.3.0
  • Stability: Beta
  • Compatibility: 1.6, 1.6.1, 1.6.2.0, 1.7, 1.11, 1.11.1, 1.12
You must be registered and logged in to get extension key.

Magento Connect 2.0

Magento Connect 2.0

RELEASE-0.3.0

The new site crawler functionality in this release adds a new User-Agent to the
default Crawler User Agents setting: "Nexcessnet_Turpentine/."
It is strongly recommended to manually add this new user agent string to the
Crawler User Agents* setting after upgrading as Magento won't automatically
update the config setting with the new default value if the config has been
saved before.
This does not apply to new installs.

  • Added built-in crawler for automatically warming the cache. Also automatically
    warms pages that are flushed on save (product/category/CMS pages)
  • Removed hard-coded "messages" block AJAX options, the ESI/AJAX options for
    the "messages" block can now be configured in the ESI layout file like any
    other block
  • Made ESI client-cache ban (clear) events configurable. See the new "ESI
    Client Cache Purge Events" option
  • Enabling the Normalize User-Agent setting now also differentiates between
    desktop and mobile browsers, for caching different output for desktop and mobile
    browsers
  • Fixed messages block not correctly updating the layout if the layout cache
    was enabled
  • AJAX loaded blocks now (quickly) fade in instead of popping in
  • Enabled continuous-integration builds for PHP 5.2, 5.3, and 5.4 through
    Travis-CI. This is only
    relevant to developers and has no effect on users of the extension

RELEASE-0.2.1

2013-01-07 19:35:14
  • Version number: 0.2.1
  • Stability: Beta
  • Compatibility: 1.6, 1.6.1, 1.6.2.0, 1.7, 1.11, 1.11.1, 1.12
You must be registered and logged in to get extension key.

Magento Connect 2.0

Magento Connect 2.0

RELEASE-0.2.1


  • Changed the syntax for dummy blocks and registry keys in the setAjaxOptions
    and setEsiOptions layout methods, see the wiki for the new syntax
  • Improved serialization of registry items in ESI/AJAX blocks
  • Fixed AJAX requests always being over HTTPS even if the main page was
    requested over HTTP
  • Changed the dummy URL to "/checkout/cart" instead of "/"
  • Fixed AJAX injection for messages block, which didn't use the standard
    layout method for block definitions. This also includes a new option to
    "Fix Flash Messages" which allows for disabling the new behavior for compatiblity
    with other AJAX extensions
  • Fixed POST request caching, which sometimes caused POST requests to fail the
    first time, and then succeed (bug introduced in RELEASE-0.2.0)
  • Fixed CE 1.6 + EE 1.11 incompatibility introduced in RELEASE-0.2.0

RELEASE-0.2.0

2012-12-12 20:15:42
  • Version number: 0.2.0
  • Stability: Beta
  • Compatibility: 1.6, 1.6.1, 1.6.2.0, 1.7, 1.11, 1.11.1, 1.12
You must be registered and logged in to get extension key.

Magento Connect 2.0

Magento Connect 2.0

RELEASE-0.2.0


  • Added AJAX injection for very short lived and/or frequently changed blocks
    (like the flash messages). This should resolve the issue with flash messages
    not displaying or displaying sporadically. To enable for other blocks, change
    the setEsiOptions method in the turpentine_esi.xml layout file to
    setAjaxOptions. Note that AJAX injected blocks are not cached at all
  • Added TTL extension for cache hits. Cached object's TTL will be extended by a
    small amount on cache hits to keep frequently used cache objects from expiring
    (unless the cache is flushed), allowing for lower TTL values to keep the cache
    from filling.
  • Prevented ESI injected blocks from being cached via Magento's block html
    caching while still allowing full block output to be cached. This is an
    improvement on the fix in RELEASE-0.1.5 for double ESI-includes
  • Fixed Magento using the ESI getBlock URL as the previously visited URL for
    visitor sessions
  • Fixed ESI injected blocks using the ESI getBlock URL as the current URL
    when rendering
  • Reduced size of generated VCL to reduce chance of hitting CLI buffer limit

RELEASE-0.1.6

2012-12-06 21:10:53
  • Version number: 0.1.6
  • Stability: Beta
  • Compatibility: 1.6, 1.6.1, 1.6.2.0, 1.7, 1.11, 1.11.1, 1.12
You must be registered and logged in to get extension key.

Magento Connect 2.0

Magento Connect 2.0

RELEASE-0.1.6

  • Add support for identifying crawlers by User-Agent in addition to IP address, see the new Crawler User Agents setting (matches Googlebot, siege, ab, and MageSpeedTest.com) by default)
  • Fix stale Login/Logout links
  • Add documentation for SSL Support

RELEASE-0.1.5

2012-12-05 17:17:02
  • Version number: 0.1.5
  • Stability: Beta
  • Compatibility: 1.6, 1.6.1, 1.6.2.0, 1.7, 1.11, 1.11.1, 1.12
You must be registered and logged in to get extension key.

Magento Connect 2.0

Magento Connect 2.0

RELEASE-0.1.5

  • Fix VCL application and saving when the Magento compiler is enabled
  • Remove defunct debug option config dependancies
  • Added *right.poll* block to default ESI cache policy
  • Fix occasional "ESI processing not enabled" message (double ESI-include)
  • Fix *Varnish Pages* refresh not flushing Varnish cache
Reviews

About the Developer

This extension was developed by and is supported by nexcess_net

Turpentine - Varnish Cache 4.6 5 20 20
Prime Cache Crashes Server Whenever I turn on / off prime crash it completely brings the server down and I have to disable, enable and then restart varnish. April 11, 2013
Store view vise customization I am using multiple store with multiserver configuration in my website(Admin on dedicated box). I want to configure this extension for frontend servers,but on admin side if i select store view extension option are not visible on the store view section, March 15, 2013
It simple and work super fast This is the best module for varnish cache, i have tried all the other possibilities out there and this worked instantly. Thanks to the developer. Best regards, and keep up the good work. March 8, 2013
Gives Magento a jetpack This is just the best fricken extension to accompany Varnish out there. There is no performance tweak that comes close to what Turpentine+Varnish can do for Magento. I feel like my site, running on a cheap VPS, can compete with the likes of those on dedicated hosts. March 3, 2013
I have noticed a small...well, maybe not so small issue. For every online client instance, magento logs 4 cache instances, like this: http://domain.com/turpentine/esi/getBlock/cacheType/per-client/ttl/300/esiData/M3I3TkZBWVNLYXlGQ0tRU2swbDhQWmdySmRvSjFpTUkwdlNhVDRlLzN2bzlPYms5Z0llbUpvOXpLcERRNkJZL2xPYUE3TGFpa2dERzRGUkRuaFNUb0EzKzA4R2JNZ2ZGU3UyVVVwbVRRNTZjOW10dUcxR2RPcDFuZG95TG05U This means 1000 visitors become 5000. January 16, 2013
Hi, I upgraded just some hours ago and it looks cool for me (page load at 60-100ms), only with Varnish I as at about 1-2 seconds and only Apache I was at 5-10 seconds. I do not like one small part in the Varnish config create from your extension: removal of the cache headers. So I just comment out the two lines created by your extension in default.vcl. ... #call remove_cache_headers; #set beresp.ttl = 28800s; ... Thanks and congratulation BR Markus January 14, 2013
I tries this out on a demo system, varnish running with 250MB memory backed storage... pretty standard setup I expect - just moved the backend to 127.0.0.1 and put this in front. ttfb ( this is a demo shop install ) went *UP* from 350ms to 1250! Any ideas where to start looking? This is a nginx /php-fpm config. January 2, 2013
Hi there, Im having some issues with Varnish. Everything is caching as expected. However some onsite JS (Ajax add to cart) returns Error on first load but okay on 2nd load. Any help would be appreciated! December 27, 2012
Just installed varnish and turpentine, everything is working as expected. However, how do I know if Varnish is caching? December 26, 2012
Thanks for the fine extension! It really works better than others at MagentoConnect, but I have some bugs in admin area. In System > Varnish Management don't work functions. No one. After click on any button, I'm redirecting to Magento error page: "There has been an error processing your request Exception printing is disabled by default for security reasons. Error log record number: 837656914520" November 18, 2012
<<prev2
Q&A
(6 Questions : 2 Answers)

Product Q&A

Ask your questions. Share your answers.

 
 
« Back
 
 
Sort by
Avatar Image Url:: http://www.magentocommerce.com/images/avatars/uploads/avatar_26234457
Customer avatar
After I enable Varnish and complete the install I am no longer able to view GET timthumb.php images for my homepage. Timthumb.php brings in several images for my slideshow and product slider. Anyone have any experience with getting timthumb.php images to work after enabling varnish on port 80 and setting up the turpentine plugin?

Cody
by
Betsworth22
-
1 year ago
0points
0out of 0found this question helpful.
Was this helpful?Yes0No0

Answers

Avatar Image Url:: http://www.magentocommerce.com/images/avatars/uploads/avatar_26268542
Customer avatar
Answer: 
Hi, im no expert but we managed to also install varnish and turpentine, the way i understand how it works is that varnish server is serving cached content. If timthumb.php serves dynamic images then varnish will show only the cached version. You have to create an xml block for that file. Then edit the turpentine_esi.xml and add that block with an esi parameter to tell varnish not to cache that block. When a the page is called, varnish will pull the block from the webserver and combine it with the cached version to serve the complete page. Hope this helps.
by
jpadua
-
1 year ago
0points
0out of 0found this answer helpful.
Was this helpful?Yes0No0
Avatar Image Url:: http://www.magentocommerce.com/images/avatars/uploads/avatar_371050
Customer avatar
Hi, I don't know where and how to configure Varnish.
by
jaautomacao
-
9 months ago
0points
0out of 0found this question helpful.
Was this helpful?Yes0No0

Answers

Avatar Image Url:: http://www.magentocommerce.com/images/avatars/uploads/avatar_27405268
Customer avatar
Answer: 
Hi,

After installation go to your Configuration panel.
( System > Configuration ).

In left panel there has to be a "Turpentine" option list. And in that list you can see Varnish and Caching options pages
by
semihmasat
-
3 months ago
+1point
1out of 1found this answer helpful.
Was this helpful?Yes1No0
 
0 answers

Tracking

Avatar Image Url:: http://www.magentocommerce.com/images/avatars/uploads/avatar_25884151
Customer avatar
Since we installed Turpentine Varnish our E-Commerce Tracking does not work anymore.

Is this a known problem?

Thank you for the great work!

Best regards
Daniel Meyer
by
visuwerkdm
-
5 months, 1 week ago
0points
0out of 0found this question helpful.
Was this helpful?Yes0No0
Avatar Image Url:: http://www.magentocommerce.com/images/avatars/uploads/avatar_27401563
Customer avatar
How do you integrate turpentine vcl with Unixy?
by
jasonnovember
-
2 months, 4 weeks ago
0points
0out of 0found this question helpful.
Was this helpful?Yes0No0
 
0 answers

1.8.1.0 Compatibility

Avatar Image Url:: http://www.magentocommerce.com/images/avatars/uploads/avatar_27347772
Customer avatar
Does this work with CE 1.8.1.0?
by
sml12
-
3 months, 3 weeks ago
0points
0out of 0found this question helpful.
Was this helpful?Yes0No0
 
0 answers

Success on ajax call

Avatar Image Url:: http://www.magentocommerce.com/images/avatars/uploads/avatar_392532
Customer avatar
Hey! Great extension! Thank you!
Is there a way to call a jquery function on an object loaded with turpentine through ajax after it finished loading? ( similar to "success" from jquery ajax)
by
ddevil
-
2 weeks, 4 days ago
0points
0out of 0found this question helpful.
Was this helpful?Yes0No0
1 of 1
1 of 1
Get Help

Support for This Extension

The best place to start if you need help with a specific extension is to contact the developer. All Magento developers have both a contact email and a support email listed.

Magento Platform Support

If you need support for a Magento platform, there are different options for support depending on which Magento platform you are using. Below are links for specific platforms.

In order to upload extension, you must be logged in to the Magento Community. Click here to login or register.

Close

Register

* Required Fields

Close window

Forgot Your Password?

Please enter your email below and we'll send you a new password.

* Required Fields

Close window

Login

To upload extension you must be logged in.

* Required Fields

Close window

You are using an outdated browser

We built Magento Connect using the latest techniques and technologies.
This makes Magento Connect faster and easier to use.
Unfortunately, your browser doesn't support those technologies.
Use the links below to download a new browser or upgrade your existing browser.