Closed (fixed)
Project:
Varnish
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
30 Sep 2010 at 17:43 UTC
Updated:
25 Jun 2011 at 21:32 UTC
Jump to comment: Most recent file
Is anyone working on a Drupal 7 version of the Varnish module? We may need this and I wanted to check here before doing any work on the code.
| Comment | File | Size | Author |
|---|---|---|---|
| #26 | varnish-927860-26.patch | 14.7 KB | bshelton |
| #23 | varnish-927860-23.patch | 9 KB | fabsor |
| #5 | varnish-drupal-7-upgrade-927860-3.patch | 9.12 KB | fabsor |
| #2 | drupal-7-upgrade-927860-2.patch | 4.2 KB | Ian Ward |
| #1 | drupal-7-upgrade-927860-1.patch | 3.97 KB | Ian Ward |
Comments
Comment #1
Ian Ward commentedAttached is a patch which just gets the module working with D7, but does not include any type of feature-upgrading or design improvements based on D7 core changes. I just put this up here for now in order to allow testing and basic usage on D7. Note, patches http://drupal.org/node/808314#comment-3442992 and http://drupal.org/node/905980#comment-3532422 are also needed but not included in this patch itself.
Comment #2
Ian Ward commentedNew patch to include hook_node_delete
Comment #3
fabsor commentedThis certainly needs a review =)
Comment #4
fabsor commentedLet's start with coding standards. Everything seems fine at a first glance expect:
Woops, a spacing here.
I will be coming back for a review on the functionality.
Powered by Dreditor.
Comment #5
fabsor commentedI did a testing round with the module in Drupal 7, and it works.
However, I noticed and fixed the following:
* The varnish settings menu item should probably not be on the first level of settings =) I moved it to admin/config/development/varnish, where it shares the space with Performance settings.
* The status of varnish wasn't working. Changed #value to #markup, and removed the ul list, since it is quite unnecessary.
* Fixed numerous coding standards changes between 6 and 7.
The new attached patch contains the other patches listed in the previous entry. I added them since it will be much simpler to review, and the Drupal 7 version will have it's own branch anyway.
Comment #6
amanaplan commentedsubscribing
Comment #7
willmoy commentedThe patch at #5 applies, apart from the .info chunk which is trivial. It seems to work (installs successfully, config appears, reports are generated) but I haven't got varnish configured yet so can't prove the important bit works.
Comment #8
geekgirlweb commented+1 Subscribing
Comment #9
fabsor commented@willmoy: Did you fetch the latest from CVS? Everything applied fine when I tried.
Anyone else who can confirm that the info chunk fails?
Comment #10
amanaplan commentedComment #11
willmoy commentedNope, I used the Nov 12 -dev tarball, so that explains that
Comment #12
chipzz commentedThis line looks obviously incorrect:
+ $items['admin/config/development/varnish'] = array(
Varnish has nothing whatsoever to do with development, and quite the contrary, is sth you would NOT use on a development site, but on a live site only.
Comment #13
amanaplan commentedThis is the most logical and convention following location since Performance (caching, etc.) is also contained here.
Comment #14
ogi commentedsubscribe
Comment #15
nasso commentedsubscribe
Comment #16
davycw commentedsubscribing
Comment #17
kultmarke commentedsubscribe
Comment #18
mgiffordWhat does the Varnish module do which D7 doesn't already provide? Certainly in pre-launch talk on the subject, it seemed like there would be as good native support for Varnish as there is for Pressflow. Am I missing something or were the claims exaggerated?
Comment #19
fabsor commentedThe varnish module has never provided support for Varnish and other reverse proxy cache servers. This is what we used Pressflow or patches for in D6.
What the Varnish module does is connecting to the varnish service port. It can then issue commands for purging parts of or all of the cache stored in Varnish. It is basicly a very handy tool to use when you have the need to purge your Varnish cache from Drupal.
The Varnish module could also potentially support other commands supported by the Varnish Service interface in the future.
Comment #20
mgiffordOk, that makes a lot of sense. Nicer to do that from drupal than have to jump to the command line.
Comment #21
gorillaz.f commentedsubscribing...
Comment #22
Shadlington commentedSubscribing
Comment #23
fabsor commentedHere is a reroll after the git migration.
Comment #24
mrsinguyen commentedSubscribing
Comment #25
chipzz commentedNevermind, I should get my facts straight before commenting.
Comment #26
bshelton commentedHere is a patch on top of the varnish-927860-23.patch in comment #23 that uses Tim Whitlock's VarnishAdminSocket library. We upgraded a site in our AWS environment to D7 recently, and I had to scramble a bit to get the varnish module working in that environment quickly. We use the -S secret key option and the VarnishAdminSocket library worked really well with it.
I have a port here that we're using until the official D7 version comes out:
https://github.com/bshelton229/varnish
Reading the server list and secret key from files is easier for us the way our AWS environment is set up right now.
If anything in there looks interesting I'd be really happy to help.
Comment #27
fabsor commentedThe library looks like a good idea, and it's way more feature complete than what we have now, but I would be a little bit reluctant in adding at as a dependency, since installing libraries is a pain.
Also, I would like to know a little more about the library. The D6 version of this module is currently used by more than 1400 people, and I guess it works for most of them. We also have very competent people working on this module in the queue, so it might be a good idea to implement the functionality in the library ourselves, since that means we can have it in one place, which makes it easier to work on this project within the infrastructure of drupal.org
If we decide to roll with the library, we need to remove the library from the patch since it is MIT licensed, and therefore incompatible with drupal.org.
I will be working on the D7 version of the varnish module during the code sprint on friday at DrupalCon Chicago together with joshk. I hope everyone that's interested will join in!
Comment #28
bshelton commentedSorry about that, I completely spaced the licensing issue. Implementing any needed functionality directly definitely seems a better approach. I wish I could make the code sprint.
Comment #29
fabsor commentedThis needs a huge reroll after a lot of patches got commited. We are currently prioritizing getting the D6 version stable, and after that we will open a new branch, and incorporate some real changes in the D7 branch.
Comment #30
carlos8f commented@fabsor, big thanks for cleaning up the queue. Rock on :)
Comment #31
Shadlington commentedJust re-titling for dashboard-goodness
Comment #32
BenK commentedSubscribing
Comment #33
danepowell commentedsub
Comment #34
torgospizzaSubscribing!
Comment #35
pcambrasuscribe
Comment #36
Remon commentedsubscribe
Comment #37
tomgf commentedsubscribe
Comment #38
mirzu commentedCan this work be checked in as a d7 dev branch? Or is there another initiative?
Comment #39
fabsor commentedWe are currently focusing on getting a stable D6 release out, and then base the D7 branch out of that. I will talk to Josh about how we can proceed further with the D7 release, and a road map for whats left for D6.
Comment #40
damien tournoud commentedAlso, for Drupal 7, this module needs to be rewritten as a cache implementation (replacing the page cache). This way it will be able to react to flush of the page cache directly, without needing any of the current hack in hook_nodeapi(), hook_comment(), hook_user(), hook_form_alter(), and the infamous hook_flush_caches().
Comment #41
carlos8f commented@Damien, that's a very interesting idea. It would certainly make the module a lot cleaner :)
I run a patch on some of my D6 sites that has cache_clear_all() trigger a shutdown function which clears varnish. The results are iffy, since the whole cache is dumped extremely frequently. It works for sites that only have a few posts per day, but sites with a large number of commenters or logged in sessions will really suffer. Basically your cache will stick around for a total of 10 seconds at a time. On those types of sites, I don't use the varnish module and just rely on a shorter cache lifetime (15-30 minutes) instead.
Comment #42
fabsor commented@Damien That is a very interesting idea indeed. I will definitely have a look at that.
Comment #43
m4oliveisubscribe
Comment #44
rwohlebsubscribe
Comment #45
mraichelson commentedsubscribing
Comment #46
dlenz commentedalso
Comment #47
fabsor commentedTo all subscribers: If you have time to review The issues outlined in #1127752: Roadmap: Drupal 6 stable release please do so! The faster we get those two patches in, the faster we can release a stable release of varnish for Drupal 6. A stable release for D6 means that the work on a version for D7 can begin. Thanks in advance and thank you for your interest in this project!
Comment #48
laurentchardin commentedsubscribe
Comment #49
acrollet commentedsubscribe
Comment #50
Oceanman commentedsubscribe
Why do we need a stable D6 version to move forward on a D7 version?
Comment #51
danepowell commentedJust a guess, from my own experience- because then you're not having to constantly port changes between branches.
Comment #52
danepowell commentedFYI: #1169744: Varnish - 7.x-2.x battle plan
Comment #53
fabsor commentedThere is now a 7.x branch with a working port of the Varnish module. The only difference between that version and the D6 version is that you need to specify the provided cache plugin as the cache controller for cache_page, see the front page for details. Please test the new version and report any bugs you find as separate issues.
Thanks for all the interest in this module! I hope the D7 version will work well for you, so we can release a first stable release as fast as possible! =)