Skip to content

Commit

Permalink
Merge pull request #1313 from hmphu/devel
Browse files Browse the repository at this point in the history
Keep params from original url
  • Loading branch information
miguelbalparda authored Jan 9, 2017
2 parents b3dc3da + 9819529 commit 7f1b634
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,11 @@ public function injectEsi($eventObject) {
);
}

/**
* Keep params from original url
*/
$urlOptions['_query'] = Mage::app()->getRequest()->getParams();

$esiUrl = Mage::getUrl('turpentine/esi/getBlock', $urlOptions);
if ($esiOptions[$methodParam] == 'esi') {
// setting [web/unsecure/base_url] can be https://... but ESI can never be HTTPS
Expand Down

1 comment on commit 7f1b634

@nvingenieria
Copy link

@nvingenieria nvingenieria commented on 7f1b634 May 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

I think this line added recently is not a good idea...

Say you view two different page categories. Each one has a different ID so getParams() will be different for each one (remember that internally magento manages URLs like /catalog/category/view/id/123 or /catalog/product/view/id/321), so the URL to request the ESI block would be different for every category page. The same occurs for products, cms page, and almost everything.

The ESI block URL becomes like this:
/turpentine/esi/getBlock/method/esi/access/private/ttl/7200/hmac/b3b....n06GI=/?id=123
(note the category id, product id or whatever at the end)

With this in mind, the URL for an ESI block (header for example) will be different on every catalog page, so the ESI block will be requested on every page!!

This means no matter if you declare the scope of a block as global (header is global and private, footer is global and public, most of the blocks are global), because the block will be requested on every different page, which has a big impact on performance, specially for private blocks.

Maybe I'm missing something, but this is the behaviour I got after upgrading to this version of the extensión.

Thanks
Daniel

Please sign in to comment.