From 5d22a8deb12c703e5d646fd9c81ea597fe962d05 Mon Sep 17 00:00:00 2001 From: Lyndon Hook Date: Fri, 11 Jul 2014 10:12:39 +1000 Subject: [PATCH 01/21] Include theme specific handles to ESI data for dynamic layout update cache keys --- .../community/Nexcessnet/Turpentine/Model/Observer/Esi.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php b/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php index d92b2eb94..f4f396d38 100644 --- a/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php +++ b/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php @@ -376,9 +376,9 @@ protected function _getBlockLayoutHandles( $block ) { // check if this handle has any block or reference tags that // refer to this block or a child block, unless the handle name // is blank - if( $handle !== '' && + if( $handle !== '' && ( strpos($handle, 'THEME') === 0 || $layoutXml->xpath( sprintf( - '//%s//*[@name=\'%s\']', $handle, $blockName ) ) ) { + '//%s//*[@name=\'%s\']', $handle, $blockName ) ) ) ) { $activeHandles[] = $handle; } } From 902240af9e49b3aaa1ac54f57ee038e9a6f3c6f9 Mon Sep 17 00:00:00 2001 From: Craig Carnell Date: Tue, 14 Jul 2015 13:04:18 +0100 Subject: [PATCH 02/21] Add maintenance mode that will allow debug_ips through to visit the site, all other users get the landing page --- .../Model/Varnish/Configurator/Abstract.php | 89 +++++++++++++++++++ .../Nexcessnet/Turpentine/etc/system.xml | 29 ++++++ .../Nexcessnet/Turpentine/misc/version-3.vcl | 4 + 3 files changed, 122 insertions(+) diff --git a/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php b/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php index 432157d1c..e53457bd8 100644 --- a/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php +++ b/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php @@ -633,6 +633,89 @@ protected function _vcl_sub_normalize_host() { 'normalize_host_target' => $this->_getNormalizeHostTarget() ) ); } + /** + * Get the allowed IPs when in maintenance mode + * + * @return string + */ + protected function _vcl_sub_maintenance_allowed_ips() { + if((! $this->_getDebugIps()) || ! Mage::getStoreConfig( 'turpentine_vcl/maintenance/custom_vcl_synth' ) ) { + return false; + } + + switch(Mage::getStoreConfig( 'turpentine_varnish/servers/version' )) { + case 4.0: + $tpl = <<_formatTemplate( $tpl, array( + 'debug_ips' => Mage::getStoreConfig( 'dev/restrict/allow_ips' ) ) ); + } + + /** + * Get the allowed IPs when in maintenance mode + * + * @return string + */ + protected function _vcl_sub_synth() { + if((! $this->_getDebugIps()) || ! Mage::getStoreConfig( 'turpentine_vcl/maintenance/custom_vcl_synth' ) ) { + return false; + } + + switch(Mage::getStoreConfig( 'turpentine_varnish/servers/version' )) { + case 4.0: + $tpl = <<_formatTemplate( $tpl, array( + 'vcl_synth_content' => Mage::getStoreConfig( 'turpentine_vcl/maintenance/custom_vcl_synth' ) ) ); + } + /** * Build the list of template variables to apply to the VCL template * @@ -686,6 +769,12 @@ protected function _getTemplateVars() { if( Mage::getStoreConfig( 'turpentine_vcl/normalization/host' ) ) { $vars['normalize_host'] = $this->_vcl_sub_normalize_host(); } + if( Mage::getStoreConfig( 'turpentine_vcl/maintenance/enable' ) ) { + // in vcl_recv set the allowed IPs otherwise load the vcl_error (v3)/vcl_synth (v4) + $vars['maintenance_allowed_ips'] = $this->_vcl_sub_maintenance_allowed_ips(); + // set the vcl_error from Magento database + $vars['vcl_synth'] = $this->_vcl_sub_synth(); + } $customIncludeFile = $this->_getCustomIncludeFilename(); if( is_readable( $customIncludeFile ) ) { diff --git a/app/code/community/Nexcessnet/Turpentine/etc/system.xml b/app/code/community/Nexcessnet/Turpentine/etc/system.xml index fce48ecfd..f1c2fa606 100644 --- a/app/code/community/Nexcessnet/Turpentine/etc/system.xml +++ b/app/code/community/Nexcessnet/Turpentine/etc/system.xml @@ -476,6 +476,35 @@ + + + text + 46 + 1 + 0 + 0 + + + + select + turpentine/config_select_toggle + If enabled IP's not in 'developer client restrictions' will receive the following error page + 10 + 1 + 0 + 0 + + + + textarea + Enter full HTML page content + 20 + 1 + 0 + 0 + + + diff --git a/app/code/community/Nexcessnet/Turpentine/misc/version-3.vcl b/app/code/community/Nexcessnet/Turpentine/misc/version-3.vcl index 55801b236..93b72e0fa 100644 --- a/app/code/community/Nexcessnet/Turpentine/misc/version-3.vcl +++ b/app/code/community/Nexcessnet/Turpentine/misc/version-3.vcl @@ -97,6 +97,8 @@ sub generate_session_expires { ## Varnish Subroutines sub vcl_recv { + {{maintenance_allowed_ips}} + # this always needs to be done so it's up at the top if (req.restarts == 0) { if (req.http.X-Forwarded-For) { @@ -350,6 +352,8 @@ sub vcl_fetch { # else it's not part of Magento so use the default Varnish handling } +{{vcl_synth}} + sub vcl_deliver { if (req.http.X-Varnish-Faked-Session) { # need to set the set-cookie header since we just made it out of thin air From 33e607f65ebba36c50c03a62c3c5ae4c60955635 Mon Sep 17 00:00:00 2001 From: Craig Carnell Date: Tue, 14 Jul 2015 13:10:24 +0100 Subject: [PATCH 03/21] Correct req.http.X-Forwarded-For check for V3 Users --- .../Turpentine/Model/Varnish/Configurator/Abstract.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php b/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php index e53457bd8..ca6e97ab0 100644 --- a/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php +++ b/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php @@ -663,7 +663,7 @@ protected function _vcl_sub_maintenance_allowed_ips() { $tpl = << Date: Thu, 13 Aug 2015 09:39:54 +0100 Subject: [PATCH 04/21] Fix merge conflict --- .../Turpentine/Model/Varnish/Configurator/Abstract.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php b/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php index 8726fb6c7..17cdca062 100644 --- a/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php +++ b/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php @@ -680,7 +680,8 @@ protected function _vcl_sub_normalize_host() { 'normalize_host_target' => $this->_getNormalizeHostTarget() ) ); } - /* Get the hostname for cookie normalization + /** + * Get the hostname for cookie normalization * * @return string */ From 1209ee1a62674df82230f1334bd9badeb0caac53 Mon Sep 17 00:00:00 2001 From: Tim Muller Date: Thu, 3 Sep 2015 13:18:59 +0200 Subject: [PATCH 05/21] DetermineVersion 3.0 to 3.0.3 bugfix --- .../Nexcessnet/Turpentine/Model/Varnish/Admin/Socket.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Admin/Socket.php b/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Admin/Socket.php index 595b15384..65bdd6b36 100644 --- a/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Admin/Socket.php +++ b/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Admin/Socket.php @@ -357,7 +357,13 @@ protected function _determineVersion($bannerText) { Mage::throwException('Varnish versions before 2.1 are not supported'); } if ( count($bannerText)<7 ) { - // Varnish before 3.0 does not spit out a version number + // Varnish before 3.0.4 does not spit out a version number + $resp = $this->_write( 'help' )->_read(); + if( strpos( $resp['text'], 'ban.url' ) !== false ) { + // Varnish versions 3.0 through 3.0.3 do not return a version banner. + // To differentiate between 2.1 and 3.0, we check the existence of the ban.url command. + return '3.0'; + } return '2.1'; } elseif ( preg_match(self::REGEXP_VARNISH_VERSION, $bannerText[4], $matches)===1 ) { return $matches['vmajor'] . '.' . $matches['vminor']; From ac0deeb6f83721007ba21b28115f4fa4d7caf12c Mon Sep 17 00:00:00 2001 From: Craig Carnell Date: Thu, 3 Sep 2015 14:28:31 +0100 Subject: [PATCH 06/21] Add missing maintenance_allowed_ips to version 4 VCL --- app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl b/app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl index ac3690894..52913cd9f 100644 --- a/app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl +++ b/app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl @@ -102,6 +102,8 @@ sub generate_session_expires { ## Varnish Subroutines sub vcl_recv { + {{maintenance_allowed_ips}} + # this always needs to be done so it's up at the top if (req.restarts == 0) { if (req.http.X-Forwarded-For) { From b29dfce3400a03290f0cdfe58aa6366cbfbbdf6d Mon Sep 17 00:00:00 2001 From: Craig Carnell Date: Thu, 3 Sep 2015 14:33:49 +0100 Subject: [PATCH 07/21] add missing vcl_synth to version 4 vcl --- app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl b/app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl index 52913cd9f..f81f440b2 100644 --- a/app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl +++ b/app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl @@ -352,6 +352,8 @@ sub vcl_backend_response { # else it's not part of Magento so use the default Varnish handling } +{{vcl_synth}} + sub vcl_deliver { if (req.http.X-Varnish-Faked-Session) { # need to set the set-cookie header since we just made it out of thin air From 390c6c6861093a1ede4c4f5fdead5ef55d755c40 Mon Sep 17 00:00:00 2001 From: Thomas Hampe Date: Mon, 14 Sep 2015 13:25:55 +0200 Subject: [PATCH 08/21] Send unmodified url to backend server --- .../Model/Varnish/Configurator/Abstract.php | 9 ++++++++ .../Nexcessnet/Turpentine/etc/config.xml | 1 + .../Nexcessnet/Turpentine/etc/system.xml | 14 +++++++++++ .../Nexcessnet/Turpentine/misc/version-2.vcl | 23 ++++++++++++++++++- .../Nexcessnet/Turpentine/misc/version-3.vcl | 17 +++++++++++++- .../Nexcessnet/Turpentine/misc/version-4.vcl | 19 ++++++++++++++- 6 files changed, 80 insertions(+), 3 deletions(-) diff --git a/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php b/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php index b33feee45..cd94ca891 100644 --- a/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php +++ b/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php @@ -379,6 +379,14 @@ protected function _getIgnoreGetParameters() return implode( '|', $ignoredParameters); } + /** + * @return boolean + */ + protected function _sendUnModifiedUrlToBackend() + { + return Mage::getStoreConfigFlag('turpentine_vcl/params/transfer_unmodified_url'); + } + /** * Get the Generate Session * @@ -844,6 +852,7 @@ protected function _getTemplateVars() { 'default_ttl' => $this->_getDefaultTtl(), 'enable_get_excludes' => ($this->_getGetParamExcludes() ? 'true' : 'false'), 'enable_get_ignored' => ($this->_getIgnoreGetParameters() ? 'true' : 'false'), + 'send_unmodified_url' => ($this->_sendUnModifiedUrlToBackend() ? 'true' : 'false'), 'debug_headers' => $this->_getEnableDebugHeaders(), 'grace_period' => $this->_getGracePeriod(), 'force_cache_static' => $this->_getForceCacheStatic(), diff --git a/app/code/community/Nexcessnet/Turpentine/etc/config.xml b/app/code/community/Nexcessnet/Turpentine/etc/config.xml index 2ca4e4fa4..a0794aa9a 100644 --- a/app/code/community/Nexcessnet/Turpentine/etc/config.xml +++ b/app/code/community/Nexcessnet/Turpentine/etc/config.xml @@ -80,6 +80,7 @@ __SID,XDEBUG_PROFILE utm_source,utm_medium,utm_campaign,utm_content,utm_term,gclid,cx,ie,cof,siteurl + 0 1 diff --git a/app/code/community/Nexcessnet/Turpentine/etc/system.xml b/app/code/community/Nexcessnet/Turpentine/etc/system.xml index cc4a7b190..f05686094 100644 --- a/app/code/community/Nexcessnet/Turpentine/etc/system.xml +++ b/app/code/community/Nexcessnet/Turpentine/etc/system.xml @@ -541,6 +541,20 @@ 0 0 + + + + By default the backend server (webserver / magento) gets a modified URL (without ignored get parameters). + As a result the ignored parameters can not be used by the backend server for uncachable requests, for example a redirect. + By activating this option the backend server gets the the unmodified url, but the cache still uses the modified url for lookups. + + select + adminhtml/system_config_source_yesno + 21 + 1 + 0 + 0 + diff --git a/app/code/community/Nexcessnet/Turpentine/misc/version-2.vcl b/app/code/community/Nexcessnet/Turpentine/misc/version-2.vcl index cb63ea02f..5fa385f5d 100644 --- a/app/code/community/Nexcessnet/Turpentine/misc/version-2.vcl +++ b/app/code/community/Nexcessnet/Turpentine/misc/version-2.vcl @@ -104,6 +104,13 @@ sub vcl_recv { set req.http.X-Opt-Enable-Caching = "{{enable_caching}}"; set req.http.X-Opt-Force-Static-Caching = "{{force_cache_static}}"; set req.http.X-Opt-Enable-Get-Excludes = "{{enable_get_excludes}}"; + set req.http.X-Opt-Send-Unmodified-Url = "{{send_unmodified_url}}"; + + + if(req.http.X-Opt-Send-Unmodified-Url == "true") { + # save unmodified url + set req.http.X-Varnish-Origin-Url = req.url; + } # Normalize request data before potentially sending things off to the # backend. This ensures all request types get the same information, most @@ -200,7 +207,14 @@ sub vcl_recv { set req.url = regsuball(req.url, "(?:(\?)?|&)(?:{{get_param_ignored}})=[^&]+", "\1"); set req.url = regsuball(req.url, "(?:(\?)&|\?$)", "\1"); } - + + + if(req.http.X-Opt-Send-Unmodified-Url == "true") { + # change req.url back and save the modified for cache look-ups in a separate variable + set req.http.X-Varnish-Cache-Url = req.url; + set req.url = req.http.X-Varnish-Origin-Url; + unset req.http.X-Varnish-Origin-Url; + } return (lookup); } @@ -220,6 +234,13 @@ sub vcl_pipe { # } sub vcl_hash { + + if({{send_unmodified_url}} && req.http.X-Varnish-Cache-Url) { + set req.hash += req.http.X-Varnish-Cache-Url; + } else { + set req.hash += req.url; + } + set req.hash += req.url; if (req.http.Host) { set req.hash += req.http.Host; diff --git a/app/code/community/Nexcessnet/Turpentine/misc/version-3.vcl b/app/code/community/Nexcessnet/Turpentine/misc/version-3.vcl index 3b8e3217f..18c721500 100644 --- a/app/code/community/Nexcessnet/Turpentine/misc/version-3.vcl +++ b/app/code/community/Nexcessnet/Turpentine/misc/version-3.vcl @@ -107,6 +107,11 @@ sub vcl_recv { } } + if({{send_unmodified_url}}) { + # save the unmodified url + set req.http.X-Varnish-Origin-Url = req.url; + } + # Normalize request data before potentially sending things off to the # backend. This ensures all request types get the same information, most # notably POST requests getting a normalized user agent string to empower @@ -202,6 +207,11 @@ sub vcl_recv { set req.url = regsuball(req.url, "(?:(\?)&|\?$)", "\1"); } + if({{send_unmodified_url}}) { + set req.http.X-Varnish-Cache-Url = req.url; + set req.url = req.http.X-Varnish-Origin-Url; + unset req.http.X-Varnish-Origin-Url; + } # everything else checks out, try and pull from the cache return (lookup); @@ -222,7 +232,12 @@ sub vcl_pipe { # } sub vcl_hash { - hash_data(req.url); + + if({{send_unmodified_url}} && req.http.X-Varnish-Cache-Url) { + hash_data(req.http.X-Varnish-Cache-Url); + } else { + hash_data(req.url); + } if (req.http.Host) { hash_data(req.http.Host); } else { diff --git a/app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl b/app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl index ac3690894..4f75aa1af 100644 --- a/app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl +++ b/app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl @@ -121,6 +121,11 @@ sub vcl_recv { return (pipe); } + if({{send_unmodified_url}}) { + # save the unmodified url + set req.http.X-Varnish-Origin-Url = req.url; + } + # remove double slashes from the URL, for higher cache hit rate set req.url = regsuball(req.url, "(.*)//+(.*)", "\1/\2"); @@ -206,6 +211,12 @@ sub vcl_recv { set req.url = regsuball(req.url, "(?:(\?)&|\?$)", "\1"); } + if({{send_unmodified_url}}) { + set req.http.X-Varnish-Cache-Url = req.url; + set req.url = req.http.X-Varnish-Origin-Url; + unset req.http.X-Varnish-Origin-Url; + } + # everything else checks out, try and pull from the cache return (hash); } @@ -225,7 +236,13 @@ sub vcl_pipe { # } sub vcl_hash { - hash_data(req.url); + + if({{send_unmodified_url}} && req.http.X-Varnish-Cache-Url) { + hash_data(req.http.X-Varnish-Cache-Url); + } else { + hash_data(req.url); + } + if (req.http.Host) { hash_data(req.http.Host); } else { From ba8fa7e8cf362874166ffd46689432999ce90ed5 Mon Sep 17 00:00:00 2001 From: mbalparda Date: Tue, 15 Sep 2015 10:06:52 -0300 Subject: [PATCH 09/21] refs Added PRs to CHANGELOG.md and bump version. --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c18e9ee89..ec1da9657 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -413,3 +413,6 @@ Magento CE 1.8+ or EE 1.13+, see [these instructions](https://github.com/nexcess ### RELEASE-0.6.5 * Varnish 4 (@aheadley @aricwatson) + +### RELEASE-0.6.6 + * [#923] DetermineVersion 3.0 to 3.0.3 bugfix (@timmuller) From bb4c82b6c84b2a6e9db8789046cb72c5974e2b85 Mon Sep 17 00:00:00 2001 From: mbalparda Date: Tue, 15 Sep 2015 10:12:24 -0300 Subject: [PATCH 10/21] refs Added PRs to CHANGELOG.md and bump version. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec1da9657..d995971d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -416,3 +416,4 @@ Magento CE 1.8+ or EE 1.13+, see [these instructions](https://github.com/nexcess ### RELEASE-0.6.6 * [#923] DetermineVersion 3.0 to 3.0.3 bugfix (@timmuller) + * [#945] Send unmodified url to the backend server (@thampe) From 67363b522849f9e13c537c9416dbab1196b16048 Mon Sep 17 00:00:00 2001 From: mbalparda Date: Thu, 17 Sep 2015 11:13:56 -0300 Subject: [PATCH 11/21] refs Added PRs to CHANGELOG.md and bump version. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d995971d3..a8d5e7867 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -417,3 +417,4 @@ Magento CE 1.8+ or EE 1.13+, see [these instructions](https://github.com/nexcess ### RELEASE-0.6.6 * [#923] DetermineVersion 3.0 to 3.0.3 bugfix (@timmuller) * [#945] Send unmodified url to the backend server (@thampe) + * [#885] Add maintenance mode that will allow debug_ips through to visit the site, all other users get the landing page (@craigcarnell) From 75d1a58d7b230da6db2907ecc4f91fdfe140ab18 Mon Sep 17 00:00:00 2001 From: mbalparda Date: Mon, 21 Sep 2015 09:58:16 -0300 Subject: [PATCH 12/21] refs Added PRs to CHANGELOG.md and bump version. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8d5e7867..bfb3cdaeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -418,3 +418,4 @@ Magento CE 1.8+ or EE 1.13+, see [these instructions](https://github.com/nexcess * [#923] DetermineVersion 3.0 to 3.0.3 bugfix (@timmuller) * [#945] Send unmodified url to the backend server (@thampe) * [#885] Add maintenance mode that will allow debug_ips through to visit the site, all other users get the landing page (@craigcarnell) + * [#955] Include theme specific handles to ESI data (@LyndonHook) From a5f2811300760a7be09fa8ab4bebd2fd64f33d16 Mon Sep 17 00:00:00 2001 From: Craig Carnell Date: Wed, 23 Sep 2015 12:47:04 +0100 Subject: [PATCH 13/21] only return pipe when vcl_fix is enabled --- .../Turpentine/Model/Varnish/Configurator/Abstract.php | 2 +- app/code/community/Nexcessnet/Turpentine/misc/version-3.vcl | 3 +-- app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl | 5 ++--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php b/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php index cd862b140..c154b8e1f 100644 --- a/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php +++ b/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php @@ -415,7 +415,7 @@ protected function _getGenerateSessionEnd() { */ protected function _getGenerateSession() { return Mage::getStoreConfig( 'turpentine_varnish/general/vcl_fix' ) - ? '# call generate_session' : 'call generate_session;'; + ? 'return (pipe);' : 'call generate_session;'; } diff --git a/app/code/community/Nexcessnet/Turpentine/misc/version-3.vcl b/app/code/community/Nexcessnet/Turpentine/misc/version-3.vcl index 78bd68d8f..115c1887f 100644 --- a/app/code/community/Nexcessnet/Turpentine/misc/version-3.vcl +++ b/app/code/community/Nexcessnet/Turpentine/misc/version-3.vcl @@ -177,8 +177,7 @@ sub vcl_recv { set req.http.Cookie = "frontend=crawler-session"; } else { # it's a real user, make up a new session for them - {{generate_session}}# call generate_session; - return (pipe); + {{generate_session}} } } if ({{force_cache_static}} && diff --git a/app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl b/app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl index 567f05c22..996028d3a 100644 --- a/app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl +++ b/app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl @@ -21,7 +21,7 @@ vcl 4.0; ## Custom C Code C{ - # @source app/code/community/Nexcessnet/Turpentine/misc/uuid.c + // @source app/code/community/Nexcessnet/Turpentine/misc/uuid.c {{custom_c_code}} }C @@ -175,8 +175,7 @@ sub vcl_recv { set req.http.Cookie = "frontend=crawler-session"; } else { # it's a real user, make up a new session for them - {{generate_session}}# call generate_session; - return (pipe); + {{generate_session}} } } if ({{force_cache_static}} && From 483b9b33d76a25b7a2aa87c0fbb3973672d6e2f8 Mon Sep 17 00:00:00 2001 From: Craig Carnell Date: Wed, 23 Sep 2015 13:05:47 +0100 Subject: [PATCH 14/21] fix no such module extendedvarnish crash in admin system --- app/code/community/Nexcessnet/Turpentine/etc/system.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/community/Nexcessnet/Turpentine/etc/system.xml b/app/code/community/Nexcessnet/Turpentine/etc/system.xml index 51c95cbd9..396871326 100644 --- a/app/code/community/Nexcessnet/Turpentine/etc/system.xml +++ b/app/code/community/Nexcessnet/Turpentine/etc/system.xml @@ -541,7 +541,7 @@ 0 0 - + By default the backend server (webserver / magento) gets a modified URL (without ignored get parameters). From 88160f1b33fc01a87edafc3bfd32d0c5d0a9fc2e Mon Sep 17 00:00:00 2001 From: Craig Carnell Date: Wed, 23 Sep 2015 13:15:06 +0100 Subject: [PATCH 15/21] fix comment in v4 VCL --- app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl b/app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl index 567f05c22..3c0ab960c 100644 --- a/app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl +++ b/app/code/community/Nexcessnet/Turpentine/misc/version-4.vcl @@ -16,7 +16,7 @@ vcl 4.0; # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -## Nexcessnet_Turpentine Varnish v3 VCL Template +## Nexcessnet_Turpentine Varnish v4 VCL Template ## Custom C Code From a82ba6bbc9e5c087d25a8da4a8500730ba2f933b Mon Sep 17 00:00:00 2001 From: Craig Carnell Date: Wed, 23 Sep 2015 17:06:54 +0100 Subject: [PATCH 16/21] use getStoreConfigFlag --- .../Turpentine/Model/Varnish/Configurator/Abstract.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php b/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php index c154b8e1f..393e00d04 100644 --- a/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php +++ b/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php @@ -414,7 +414,7 @@ protected function _getGenerateSessionEnd() { * @return string */ protected function _getGenerateSession() { - return Mage::getStoreConfig( 'turpentine_varnish/general/vcl_fix' ) + return Mage::getStoreConfigFlag( 'turpentine_varnish/general/vcl_fix' ) ? 'return (pipe);' : 'call generate_session;'; } From 5d6190c5db5caa231407b466ecf359d69aac3ee5 Mon Sep 17 00:00:00 2001 From: aricwatson Date: Wed, 30 Sep 2015 15:17:05 -0400 Subject: [PATCH 17/21] add disable ESI injection option Adds an option to disable ESI injection on specific blocks --- .../community/Nexcessnet/Turpentine/Model/Observer/Esi.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php b/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php index 881bf748d..2aeff4c0a 100644 --- a/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php +++ b/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php @@ -230,6 +230,11 @@ public function injectEsi( $eventObject ) { if( $esiHelper->shouldResponseUseEsi() && $blockObject instanceof Mage_Core_Block_Template && $esiOptions = $blockObject->getEsiOptions() ) { + + if ((isset($esiOptions['disableEsiInjection'])) && ($esiOptions['disableEsiInjection'] == 1)) { + return; + } + if( Mage::app()->getStore()->getCode() == 'admin' ) { // admin blocks are not allowed to be cached for now $debugHelper->logWarn( From d7afeffddd10a120928b6a7298bdd676ef9b873c Mon Sep 17 00:00:00 2001 From: Tsvetan Stoychev Date: Sun, 4 Oct 2015 17:12:54 +0200 Subject: [PATCH 18/21] #971 - Fixed bug with wrong return value of ->getSkinUrl() in ESI context. --- .../community/Nexcessnet/Turpentine/Model/Observer/Esi.php | 2 -- .../Nexcessnet/Turpentine/controllers/EsiController.php | 3 --- 2 files changed, 5 deletions(-) diff --git a/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php b/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php index c337066e7..6a9af13e3 100644 --- a/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php +++ b/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php @@ -326,8 +326,6 @@ protected function _getEsiData( $blockObject, $esiOptions ) { $esiData = new Varien_Object(); $esiData->setStoreId( Mage::app()->getStore()->getId() ); $esiData->setDesignPackage( Mage::getDesign()->getPackageName() ); - $esiData->setDesignTheme( Mage::getDesign()->getTheme( 'layout' ) ); - $esiData->setNameInLayout( $blockObject->getNameInLayout() ); $esiData->setBlockType( get_class( $blockObject ) ); $esiData->setLayoutHandles( $this->_getBlockLayoutHandles( $blockObject ) ); $esiData->setEsiMethod( $esiOptions[$methodParam] ); diff --git a/app/code/community/Nexcessnet/Turpentine/controllers/EsiController.php b/app/code/community/Nexcessnet/Turpentine/controllers/EsiController.php index 3bfe0d495..8d2521bba 100644 --- a/app/code/community/Nexcessnet/Turpentine/controllers/EsiController.php +++ b/app/code/community/Nexcessnet/Turpentine/controllers/EsiController.php @@ -183,9 +183,6 @@ protected function _getEsiBlock( $esiData ) { } } $layout = Mage::getSingleton( 'core/layout' ); - Mage::getSingleton( 'core/design_package' ) - ->setPackageName( $esiData->getDesignPackage() ) - ->setTheme( $esiData->getDesignTheme() ); // dispatch event for adding handles to layout update Mage::dispatchEvent( From 55f147f4660bb421ac2f9bd29e540d34f609310c Mon Sep 17 00:00:00 2001 From: Tsvetan Stoychev Date: Sun, 4 Oct 2015 17:39:07 +0200 Subject: [PATCH 19/21] #971 - Restored a value that was removed by mistake in previous commit. --- app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php b/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php index 6a9af13e3..5124e706e 100644 --- a/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php +++ b/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php @@ -325,7 +325,7 @@ protected function _getEsiData( $blockObject, $esiOptions ) { $methodParam = $esiHelper->getEsiMethodParam(); $esiData = new Varien_Object(); $esiData->setStoreId( Mage::app()->getStore()->getId() ); - $esiData->setDesignPackage( Mage::getDesign()->getPackageName() ); + $esiData->setNameInLayout( $blockObject->getNameInLayout() ); $esiData->setBlockType( get_class( $blockObject ) ); $esiData->setLayoutHandles( $this->_getBlockLayoutHandles( $blockObject ) ); $esiData->setEsiMethod( $esiOptions[$methodParam] ); From 51910a56db92370469af3654cc21e73ef5ac032a Mon Sep 17 00:00:00 2001 From: mbalparda Date: Fri, 9 Oct 2015 09:39:18 -0300 Subject: [PATCH 20/21] refs Added PRs to CHANGELOG.md and bump version. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfb3cdaeb..cb1ac3a99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -419,3 +419,4 @@ Magento CE 1.8+ or EE 1.13+, see [these instructions](https://github.com/nexcess * [#945] Send unmodified url to the backend server (@thampe) * [#885] Add maintenance mode that will allow debug_ips through to visit the site, all other users get the landing page (@craigcarnell) * [#955] Include theme specific handles to ESI data (@LyndonHook) + * [#972] Fixed bug with wrong return value of ->getSkinUrl() (@ceckoslab) From c5e7ba20e9d703f3e6832850d90d9479ee0aa19f Mon Sep 17 00:00:00 2001 From: mbalparda Date: Mon, 12 Oct 2015 11:42:38 -0300 Subject: [PATCH 21/21] refs Added PRs to CHANGELOG.md and bump version. --- app/code/community/Nexcessnet/Turpentine/etc/config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/community/Nexcessnet/Turpentine/etc/config.xml b/app/code/community/Nexcessnet/Turpentine/etc/config.xml index 67e86b0ca..a9fc7eec1 100644 --- a/app/code/community/Nexcessnet/Turpentine/etc/config.xml +++ b/app/code/community/Nexcessnet/Turpentine/etc/config.xml @@ -20,7 +20,7 @@ - 0.6.6 + 0.6.7