ezramorse / zoom-magento-fpc Goto Github PK
View Code? Open in Web Editor NEWThe Zoom Full-Page Cache for Magento (by Ezra Morse of EZAPPS)
Home Page: http://www.ezapps.ca/zoom-magento-full-page-cache.html
The Zoom Full-Page Cache for Magento (by Ezra Morse of EZAPPS)
Home Page: http://www.ezapps.ca/zoom-magento-full-page-cache.html
############################################################################# I have long stopped supporting this obviously. This was a proof of concept: create regex parseable 'holes', save a cache to a structure NGINX can find with simple logic, then fill in the holes with AJAX on the client side. I hope someone can continue to improve on the concept, which can be applied to nearly any web application that needs 'help'. ############################################################################# * EZAPPS Zoom Full-Page Cache for Magento * * @category Ezapps * @package Ezapps_Zoom * @author Ezra Morse (http://www.ezramorse.com/) * @contact Ezra Morse <[email protected]> * @donate Paypal: [email protected] * @license EPL 1.0 (http://www.eclipse.org/legal/epl-v10.html) * @instructions Please credit the original author in all derivatives and release core fixes to the public Installation: ============================================ 1. Create a backup of your Magento store. If possible, install in a testing environment before porting the code live. 2. Unpack source code (or use Magento Connect and skip to step 4) 3. Goto the new ezzoom directory and copy the source to the root of your testing environment 4. Clear your Magento cache 5. Re-login to the Magento backend 6. Edit index.php. After the <?php tag, insert: include('ezzoom.php'); 7. Edit app/design/frontend/base/default/layout/ezzoom.xml. Remove all unneeded blocks from ezzoom_hole_fill handle. Removing blocks referenced by other active blocks can cause exceptions. Proceed with caution. 8. Please ensure the directory var/zoom is writable 9. If you use our category URL rewrites, adjust your robots.txt file to exclude any redundant URLs
Found another bug
2012-11-11T11:38:54+00:00 ERR (3): Warning: symlink() has been disabled for security reasons in /home/shirtmw88/domains/domain1.com/public_html/app/code/local/Ezapps/Zoom/Helper/Data.php on line 805
2012-11-11T13:37:14+00:00 ERR (3): Warning: symlink() has been disabled for security reasons in /home/shirtmw88/domains/domain1.com/public_html/app/code/local/Ezapps/Zoom/Helper/Data.php on line 803
Warning: include(Ezapps/Zoom/Model/Url.php): failed to open stream: No such file or directory /lib/Varien/Autoload.php on line 93
We have ezapps zoom installed and we also use sagepay to process our payments.
The error we get is that some customers finish their sagepay order and then they are not redirected to the success page, therefore no order is logged in magento but we still receive payment.
The customer usually thinks the order has not gone through successfully and tries to pay again.
This error does not occur when zoom cache is disabled.
The error does not happen in 100% of cases, but still happens fairly regularly.
The error was much more prevalent when we had SIDs in our URLs. We have not disabled SIDs but we have eliminated most causes for SIDs appearing (by redirecting all www URLs to our base URL which uses the non-www version). Since doing this the error doesn't happen as often.
I have not been able to replicate the error myself, so I'm a bit lost on how to fix it. The only thing I can say is that I think it is related to how zoom handles sessions and SIDs.
Lucky me, I used a dev environment to test Zoom into our Magento shop.
Didn't see much change... so I decided to to uninstall it.
When I did, I couldn't get to the admin OR the frontend. Still not sure what caused the problem... but it seems that it has altered / deleted files essential to Magento's functioning.
Was just a warning though, I don't intend to follow up :) use the coders' advises :
Cheers.
Did you manage to override or punch a hole in a named block?
From help:
Edit app/design/frontend/base/default/layout/ezzoom.xml. Remove all unneeded blocks from ezzoom_hole_fill handle.
We have a block named Magicart_Ajax_Block_Cart_Sidebar. But how can we hole punch this block?
Any help appreciated from community
http://stackoverflow.com/posts/13454314
When I try to open "View Page Cache" in the Magento Backend.
I am getting 404 error.
This happens on more than one installation.
Do you have ideas, hints?
URL is: /index.php/admin/ezzoom/adminhtml_ezzoom/
Kind regards,
Sebastian
Hi,
Zoom will work fine for several days with no issues until all of a sudden magento totally crashes and does not allow you to get to the backend or see the frontend (apart from those pages that are cached by zoom)
The only way to fix the issue is to delete he contents of var/zoom , var/cache and var/session
Once this is done the site runs good again. The error report we get looks like this
a:5:{i:0;s:59:"Mage registry key "_singleton/core/resource" already exists";i:1;s:825:"#0 /usr/share/nginx/www/app/Mage.php(192): Mage::throwException('Mage registry k...')
#1 /usr/share/nginx/www/app/Mage.php(446): Mage::register('_singleton/core...', Object(Mage_Core_Model_Resource))
#2 /usr/share/nginx/www/app/code/core/Mage/Core/Model/Resource/Setup.php(141): Mage::getSingleton('core/resource')
#3 /usr/share/nginx/www/app/code/core/Mage/Core/Model/Resource/Setup.php(234): Mage_Core_Model_Resource_Setup->__construct('core_setup')
#4 /usr/share/nginx/www/app/code/core/Mage/Core/Model/App.php(408): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /usr/share/nginx/www/app/code/core/Mage/Core/Model/App.php(336): Mage_Core_Model_App->_initModules()
#6 /usr/share/nginx/www/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#7 /usr/share/nginx/www/index.php(77): Mage::run('btn', 'website')
#8 {main}";s:3:"url";s:39:"/burton-gig-bag-estate-plaid-156cm-2012";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}
Got a problem with ezzoom when enabled with my cart if a customer has added items to there cart the block totaly removes from the cache en doesnt show up.
With another setting the block is showing but even when another customer is on my site without any items in there cart is show the number of items in cart for the customer when the page was been cached.
Anyone knows how to fix this?!
Please enhance explanation in config section. How to exclude exactly
I have added some code to clear the category cache from the linked product after saving a product.
<?php
/**
* Zoom Page Observer
*
* @category Ezapps
* @package Ezapps_Zoom
* @author Ezra Morse (http://www.ezapps.ca)
* @license: EPL 1.0
*/
class Ezapps_Zoom_Model_Observer extends Mage_Core_Model_Abstract
{
public function clearProduct($product_event) {
$product = $product_event->getProduct()->getOrigData();
/* clear category cache */
$category_ids = $product_event->getProduct()->getCategoryIds();
if(!empty($category_ids)){
foreach($category_ids as $category_id){
$_category = Mage::getModel('catalog/category')->load($category_id);
$category['category'] = $_category;
$this->clearCategory($category);
}
}
/* clear category cache */
if ($product['store_id'] != 0)
$stores[] = $product['store_id'];
else
foreach (Mage::getModel('core/store')->getCollection() as $store)
$stores[] = $store->getId();
foreach ($stores as $store_id) {
$uris = Mage::getModel('core/url_rewrite')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('product_id', array('eq' => $product['entity_id']));
foreach ($uris as $uri) {
Mage::getModel('ezzoom/page')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('uri', array('eq' => "/" . $uri->getRequestPath()))->delete();
}
$uris = Mage::getModel('core/url_rewrite')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('target_path', array('eq' => "catalog/product/view/id/" . $product['entity_id']));
foreach ($uris as $uri) {
Mage::getModel('ezzoom/page')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('uri', array('eq' => "/" . $uri->getRequestPath()))->delete();
}
Mage::getModel('ezzoom/page')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('uri', array('eq' => "/catalog/product/view/id/" . $product['entity_id']))->delete();
Mage::getModel('ezzoom/page')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('uri', array('like' => "/catalog/product/view/id/" . $product['entity_id'] . '/%'))->delete();
$uris = Mage::getModel('core/url_rewrite')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('target_path', array('eq' => "review/product/list/id/" . $product['entity_id']));
foreach ($uris as $uri) {
Mage::getModel('ezzoom/page')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('uri', array('eq' => "/" . $uri->getRequestPath()))->delete();
}
Mage::getModel('ezzoom/page')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('uri', array('eq' => "/review/product/list/id/" . $product['entity_id']))->delete();
Mage::getModel('ezzoom/page')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('uri', array('like' => "/review/product/list/id/" . $product['entity_id'] . '/%'))->delete();
}
}
public function clearCategory($category_event) {
$category = $category_event['category'];
$stores = array();
if ($category->getStoreId() != 0)
$stores[] = $category->getStoreId();
else
foreach (Mage::getModel('core/store')->getCollection() as $store)
$stores[] = $store->getId();
foreach ($stores as $store_id) {
$uris = Mage::getModel('core/url_rewrite')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('category_id', array('eq' => $category->getId()));
foreach ($uris as $uri) {
Mage::getModel('ezzoom/page')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('uri', array('eq' => "/" . $uri->getRequestPath()))->delete();
}
$uris = Mage::getModel('core/url_rewrite')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('target_path', array('eq' => 'catalog/category/view/id/' . $category->getId()));
foreach ($uris as $uri) {
Mage::getModel('ezzoom/page')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('uri', array('eq' => "/" . $uri->getRequestPath()))->delete();
}
Mage::getModel('ezzoom/page')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('uri', array('eq' => "/catalog/category/view/id/" . $category->getId()))->delete();
Mage::getModel('ezzoom/page')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('uri', array('like' => "/catalog/category/view/id/" . $category->getId() . '/%'))->delete();
}
}
public function clearCMS($cms_page) {
$orig_page = $cms_page->getPage()->getOrigData();
$stores = $orig_page['store_id'];
if (count($stores) == 1 && $stores[0] == 0) {
$stores = array();
foreach (Mage::getModel('core/store')->getCollection() as $store) {
$stores[] = $store->getId();
}
}
foreach ($stores as $store_id) {
Mage::getModel('ezzoom/page')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('uri', array('eq' => "/{$orig_page['identifier']}"))->delete();
$id = Mage::getStoreConfig('web/default/cms_home_page', $store_id);
if ($id == $orig_page['identifier']) {
Mage::getModel('ezzoom/page')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('uri', array('eq' => "/"))->delete();
}
$uris = Mage::getModel('core/url_rewrite')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('target_path', array('eq' => 'cms/page/view/page_id/' . $orig_page['page_id'] ));
foreach ($uris as $uri) {
Mage::getModel('ezzoom/page')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('uri', array('eq' => "/" . $uri->getRequestPath()))->delete();
}
Mage::getModel('ezzoom/page')->getCollection()
->addFieldToFilter('store_id', array('eq' => $store_id))
->addFieldToFilter('uri', array('eq' => 'cms/page/view/page_id/' . $orig_page['page_id']))->delete();
}
}
}
When enabling it, the error log showed this:
PHP Fatal error: Class 'Mage_Ezzoom_Helper_Data' not found in magento/app/Mage.php on line 546
I haven't looked deeper, maybe that's caused by my own environment. Just create an issue first. I'll update it if I find the reason. :)
I've installed the extension from magento connect and my system.log is full of
2013-11-21T08:21:55+00:00 ERR (3): Warning: include(Ezapps/Zoom/Handler.php): failed to open stream: No such file or directory in /var/www/mysite/htdocs/lib/Varien/Autoload.php on line 93
How can I solve it?
Hi
I have the cart sidebar holpunched, however when frontend SID is turned on the holepunch appears blank.
When it is turned off, it works fine.
Magento 1.6.2.0
There is an issue loading the hole punched data on product pages which seems to be due to this code in HoleController.php:
if (array_key_exists('pid', $data)) {
$product_index = Mage::getModel('reports/product_index_viewed')->getCollection()
->addFieldToFilter('store_id', array('eq' => Mage::app()->getStore()->getId()))
->addFieldToFilter('product_id', array('eq' => $data['pid']));
if ($session->isLoggedIn()) {
$product_index->addFieldToFilter('customer_id', array('eq' => $session->getCustomerId()));
if (count($product_index) < 1)
Mage::getModel('reports/product_index_viewed')
->setCustomerId($session->getCustomerId())
->setProductId($data['pid'])
->setStoreId(Mage::app()->getStore()->getId())
->save()
->calculate();
} else {
$product_index->addFieldToFilter('visitor_id', array('eq' => Mage::getSingleton('log/visitor')->getId()));
if (count($product_index) < 1)
Mage::getModel('reports/product_index_viewed')
->setVisitorId(Mage::getSingleton('log/visitor')->getId())
->setCustomerId(null)
->setProductId($data['pid'])
->setStoreId(Mage::app()->getStore()->getId())
->save()
->calculate();
}
}
It seems to stem from the fact that the reports/product_index_viewed table extends from the catalog/product collection and so the addFieldToFilter functions don't work as expected. The error I am receiving is as follows:
Call to a member function getBackend() on a non-object in /home/sites/magento.directshop.com.au/docs/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 822
For now I've commented out the code as it just seems to relate to counting product views for cached products, but it would be nice to have a solution. I noticed somebody else was having the same problem here: http://www.magentocommerce.com/boards/viewthread/275766/P30/#t391771
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.