kevincupp / purge Goto Github PK
View Code? Open in Web Editor NEWSends purge request to Varnish cache upon entry submission/deletion
Sends purge request to Varnish cache upon entry submission/deletion
What license is this under?
Just a heads up, because I'm new to Varnish and was wondering why I kept receiving compile errors in 3.x Varnish.
Purge no longer takes arguments and has become ban. In the readme, it should now be
if (req.request == "EE_PURGE") {
purge("req.http.host ~ example.com && req.url ~ ^/.*$");
error 200 "Purged";
}
See the upgrade documentation for more.
Hi,
I am a newbie to varnish and successfully installed varnish as per your instructions. Unfortunately the purge addon doesn't appear to work for me e.g. if I edit a template in Template Manager with EE2.5.5 and click Purge the template does update with the change. Take about 10 pages refreshes and over and backs
I added
if (req.request == "EE_PURGE") {
ban("req.http.host ~ example.com && req.url ~ ^/.*$");
error 200 "Purged";
}
to
vcl_recv (withing /etc/varnish/main.vcl) with my domain and added
$config['varnish_site_url'] = 'http://mysite.com';
$config['varnish_port'] = 80;
to /system/expressionengine/config/config.php
http://ellislab.com/blog/entry/making-sites-fly-with-varnish
Is there something basic I'm doing wrong?
Thanks
here is my main.vcl (' need to be replaced with " for varnishd -f /etc/varnish/main.vcl -s malloc,200M to execute)
backend default {
.host = "127.0.0.1"; # IP address of your backend (Apache, nginx, etc.)
.port = "8080"; # Port your backend is listening on
.probe = {
.url = "/";
.timeout = 34ms;
.interval = 1s;
.window = 10;
.threshold = 8;
}
}
sub vcl_recv {
if (req.request == "EE_PURGE") {
ban("req.http.host ~ academ-ee.com && req.url ~ ^/.*$");
error 200 "Purged";
}
# Forward client"s IP to backend
remove req.http.X-Forwarded-For;
set req.http.X-Forwarded-For = client.ip;
# Set the URI of your system directory
if (req.url ~ "^/system/" ||
req.url ~ "/templates/" ||
req.url ~ "ACT=" ||
req.request == "POST" ||
(req.url ~ "member_box" && req.http.Cookie ~ "exp_sessionid"))
{
return (pass);
}
unset req.http.Cookie;
set req.grace = 1h;
return(lookup);
}
sub vcl_fetch {
# Enable ESI includes
set beresp.do_esi = true;
# Our cache TTL
set beresp.ttl = 1m;
set beresp.grace = 1h;
return(deliver);
}
When attempting to publish a page, content item, etc, I get the following error:
A Database Error Occurred
Error Number: 1054
Unknown column 'site_id' in 'where clause'
SELECT * FROM (`exp_purge_rules`) WHERE `channel_id` = 1 AND `site_id` = 1
Filename: third_party/purge/ext.purge.php
Line Number: 108
After reviewing, I'm not exactly sure what the need for site_id
is in the WHERE clause, and commenting out line 107 in ext.purge.php
:
$this->EE->db->where('site_id',(int) $meta['site_id']);
does fix the issue for me. I can do a PR if needed, but I was hoping I could get more insight into the logic of having site_id
in the WHERE clause before I went down that rabbit hole.
I've installed the add-on but when we publish or update an entry we get a PHP Fatal Error: Call to undefined function send_purge_request()
I noticed when I glanced through the ext that there is no send_purge_request function and assume it's in the varnish helper? This is EE 2.5.5 if that helps.
As the title says. :)
Parse error: syntax error, unexpected '}' in /vhosts/mysiteisgreat.com/httpdocs/sys/expressionengine/third_party/purge/ext.purge.php on line 99
My extensions page is also not loading at the moment, an issue I haven't seen before. I'm gonna roll back to an earlier Purge for now and hope for the best. :)
Not really issue... more a question?
My sysadmin has setup a load balanced set of varnish servers. I would like to send the purge to both. How would you suggest we work this out? Any thoughts?
Thanks,
Taylor
Hi,
Getting "Fatal error: Call to undefined function curl_init() ....[path]/third_party/purge/helpers/varnish_helper.php on line 27 " error when creating entry. Structure 3.2.4 is installed. possible conflict with Purge?
Line 27: $ch = curl_init();
Pls advise
Thanks
Hey,
I put the purge add on in /system/expressionengine/third_party, but it isn't showing up in accessories or add-ons so I can install it.
Any thoughts?
Thanks!
Please add following line before curl_exec($ch); to varnish_helper.php :
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
because with current codes curl is sending its output to browser and causing the EE to stop and show PHP errors ...
Thanks for your very useful addon ๐
Hi Kevin
Would you be available or could you recommend someone who may be available to develop an EE3 version of this addon ?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.