Git Product home page Git Product logo

zoom-magento-fpc's Introduction

#############################################################################
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

zoom-magento-fpc's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zoom-magento-fpc's Issues

What todo when no symlink allowed?

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

Uninstalling causes errors

Warning: include(Ezapps/Zoom/Model/Url.php): failed to open stream: No such file or directory /lib/Varien/Autoload.php on line 93

Checkout errors related to ezapps extension

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.

Killed Magento after uninstalling it :)

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 :

  • make backups,
  • test it into a dev environment.

Cheers.

backend 404 error when I open View Page Cache

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

Magento eventually crashes after long term use of Zoom

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";}

problem with cart module

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?!

Clear category cache after saving product

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();


    }

    }

}

PHP Fatal error in magento 1.7.0.0

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. :)

No Ezapps/Zoom/Handler.php

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?

Hole punching does not load on product pages

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.