Skip to content

Commit

Permalink
Merge pull request #1163 from nexcess/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
miguelbalparda committed Apr 21, 2016
2 parents 6ffc751 + e312e93 commit bf24144
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,3 +432,12 @@ Magento CE 1.8+ or EE 1.13+, see [these instructions](https://github.com/nexcess

### RELEASE-0.6.8
* [#1065] Added ESI policy for cookie notice block. (@aricwatson)
* [#1066] Fix for crawler lock problem with CM_RedisSession (@jeroenvermeulen )
* [#1072] Scrutinizer Auto-Fixes. (@miguelbalparda)
* [#1078] Fix regex check - blank value passed check. (@aricwatson)
* [#1087] Fixed missing '}' typo #1087. (@aricwatson)
* [#1117] Fix #1100. (@GLips)
* [#1155] Update TECHNICAL_NOTES.md. (@GLips)

### RELEASE-0.6.9

2 changes: 1 addition & 1 deletion TECHNICAL_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ESI was originally created so that CDN providers (like Akamai) could serve their
However, actually implementing ESI in Magento is horrendously complicated as Magento doesn't seem to have been designed with rendering just a single block, rather than an entire page, which is needed to serve the actual ESI requests from Varnish. Luckily, Hugues Alary did most of the hard work and made it available in his [Magento-Varnish](https://github.com/huguesalary/Magento-Varnish) extension. The core of how both Magento-Varnish and Turpentine work is:

1. The extension has a [layout file](https://github.com/nexcess/magento-turpentine/blob/master/app/design/frontend/base/default/layout/turpentine_esi.xml) that tells the extension which blocks should be included via ESI.
2. The extension waits for the [`core_block_abstract_to_html_before`](https://github.com/nexcess/magento-turpentine/blob/master/app/code/community/Nexcessnet/Turpentine/etc/config.xml#L183) event to trigger during a request, then [examines the block](https://github.com/nexcess/magento-turpentine/blob/master/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php#L191) the event was fired for and checks whether the block should be included via ESI based on the layout file.
2. The extension waits for the [`core_block_abstract_to_html_before`](https://github.com/nexcess/magento-turpentine/blob/master/app/code/community/Nexcessnet/Turpentine/etc/config.xml#L228) event to trigger during a request, then [examines the block](https://github.com/nexcess/magento-turpentine/blob/master/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php#L220) the event was fired for and checks whether the block should be included via ESI based on the layout file.
3. If the block should be ESI included, the block's normal template is replaced by a [special template](https://github.com/nexcess/magento-turpentine/blob/master/app/design/frontend/base/default/template/turpentine/esi.phtml) with the ESI include tag that signals Varnish to instead pull the block's content from a separate request. A flag is also added to the request to signal to Varnish that the request should have ESI processing run on it.
4. The response finishes and is sent to Varnish, Varnish sees the ESI flag and sends a request to get the ESI content, which is then [rendered](https://github.com/nexcess/magento-turpentine/blob/master/app/code/community/Nexcessnet/Turpentine/controllers/EsiController.php#L58) and sent back to Varnish to be included in the original response.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

class Nexcessnet_Turpentine_Block_Poll_Activepoll extends Mage_Poll_Block_ActivePoll {
class Nexcessnet_Turpentine_Block_Poll_ActivePoll extends Mage_Poll_Block_ActivePoll {

public function setTemplate($template)
{
$this->_template = $template;
$this->setPollTemplate('turpentine/ajax.phtml', 'poll');
$this->setPollTemplate('turpentine/ajax.phtml', 'results');
$this->setPollTemplate('turpentine/ajax.phtml', 'results');
return $this;
}
}
8 changes: 4 additions & 4 deletions app/code/community/Nexcessnet/Turpentine/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<config>
<modules>
<Nexcessnet_Turpentine>
<version>0.6.8</version>
<version>0.6.9</version>
</Nexcessnet_Turpentine>
</modules>
<default>
Expand Down Expand Up @@ -53,9 +53,9 @@
<backend_host>127.0.0.1</backend_host>
<backend_port>8080</backend_port>
<backend_nodes>127.0.0.1:8080</backend_nodes>
<backend_probe_url></backend_probe_url>
<backend_probe_url/>
<backend_nodes_admin>127.0.0.1:8080</backend_nodes_admin>
<backend_probe_url_admin></backend_probe_url_admin>
<backend_probe_url_admin/>
<frontend_timeout>300</frontend_timeout>
<admin_timeout>21600</admin_timeout>
<crawlers>127.0.0.1</crawlers>
Expand Down Expand Up @@ -477,7 +477,7 @@
<observers>
<wishlist_index_index_before>
<class>turpentine/observer_esi</class>
><method>hookToAddToWishlistBefore</method>
<method>hookToAddToWishlistBefore</method>
</wishlist_index_index_before>
</observers>
</wishlist_index_index_before>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ sub vcl_deliver {
"; domain=" + regsub(req.http.Host, ":\d+$", "");
} else {
# it's a real user, allow sharing of cookies between stores
if(req.http.Host ~ "{{normalize_cookie_regex}}") {
if (req.http.Host ~ "{{normalize_cookie_regex}}" && "{{normalize_cookie_regex}}" ~ "..") {
set resp.http.Set-Cookie = resp.http.Set-Cookie +
"; domain={{normalize_cookie_target}}";
} else {
Expand Down

0 comments on commit bf24144

Please sign in to comment.