Git Product home page Git Product logo

lscache-opencart's Introduction

LiteSpeedCache for OpenCart

LiteSpeed Cache for OpenCart is a page cache extension for OpenCart sites running on LiteSpeed Web Server or OpenLiteSpeed.

  • It's simple, easy to use, and will speed up your OpenCart site up to 100 times faster, after 3 minutes of setup, with no extra cost.
  • LiteSpeed Page Cache will work whether logged in or logged out, with an empty cart or a full one.
  • LiteSpeed Cache will automatically purge a page when the related product/category/information/manufacturer data has changed. You can set a longer cache expiration time to improve visitor experience, confident that the cache will be purged when relevant content changes.
  • LiteSpeed Cache will automatically purge a cached ESI module when related product/category/information/manufacturer data has changed.
  • the advanced ESI feature and cache options for logged-in users will help run your OpenCart site as efficiently as a static file site. It will tremendously improve customer experience.

The LiteSpeed Cache extension was originally written by LiteSpeed Technologies. It is released under the GNU General Public Licence (GPLv3).

See https://www.litespeedtech.com/products/cache-plugins for more information.

Prerequisites

This version of LiteSpeed Cache requires OpenCart 2.3 or later and either LiteSpeed LSWS Server 5.2.3 or later, or OpenLiteSpeed 1.4 or later.

Installing

Download a specific version of the LiteSpeed Cache extension package from the GitHub package folder, or run buildPackage.sh to generate the latest package from the latest souce code in GitHub.

Cli Command for Rebuild All Cache

Run the following command at the website host:

curl -N "http://yoursite/index.php?route=extension/module/lscache/recache&from=cli"

Cli Command for Purge All Cache

Run the following command at the website host:

curl -N "http://yoursite/index.php?route=extension/module/lscache/purgeAll&from=cli"

See https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscoc for more information.

lscache-opencart's People

Contributors

litespeedtech avatar lslisa avatar wuhuachen avatar

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lscache-opencart's Issues

ESI serious problem!

I use Litespeed Web Server. (not openlitespeed!)
Cyberpanel + Litespeed latest versions.
Php 7.1

There is no problem when I activate LSCache over Opencart 3.0.3.2 version. But; The site is broken when I activate the ESI feature.

At first I thought this was due to the special theme I used. But I installed zero with the default theme, I just installed LSCache without installing any plugin and the result is frustrated.

The problem is that some of the HTML code on the site is DELETED when ESI is activated. The <title> tag is one of them.

I wrote this strange issue from Litespeed Support, no return for 3 days. Isn't it pointless to use a system like Opencart without ESI?

Very Serious problem --Bug report

After fully uninstall the cache extension in the backend of opencart 3.0.3.2, I can't open the admin panel of opencart anymore. (can't view the page example.com/admin)
I am using newest openlitespeed with cyberpanel and opencart V3.0.3.2.
Please tell me the correct method to fully uninstall the cache extension for opencart .
Now, I can't login to the backend .
Please try to fix it.
Bug-of-uninstall-the-extension-inOC3 0 3 2

OpenCart4x

Hello, can you please make it compatible for opencart 4.0.1.1, module not working in opencart4x

curl option for fast recache and small lscache size

in long and hard discussion with serpent_driver and researching parameters of his "superfast recaching method" finding really "magic" option for curl in crawler algorithm.

curl_setopt($ch, CURLOPT_ENCODING, "");

must be added in

/catalog/controller/extension/module)/lscache.php

after this:

curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);

after adding this options:

  • speed of recache increase up to 3 times

  • size of already generated cache decrease up to 10 times

file of cache after lscache header now contain not full html code of cached page like:

<title>Пряжа высокого качества Турции, Италии в широчайшем ассортименте - интернет-магазин "Пряжа-shop"</title>

..............
Copyright © 2019-2022, Priazha-shop, All Rights Reserved


OK
Этот сайт использует файлы cookies.
<script src="https://static.priazha-shop.com/catalog/view/theme/journal3/assets/0d6cd2a9a1e51254b9f0317c0826cc05.js?v=14218c54"></script>

now:
lscache_encoding

but lscache work!!!

Warning: Opencart 3.0.3.2

When I try to include on Opencart 3.0.3.2 / Ocstore 3 Error
Image of Yaktocat
Tried on clean install Opencart 3.0.3.2 / OcStore 3.0.2.0. LsWs 3.4 Stable
lscache-opencart3.0-V1.2.0

Cannot declare class Mobile_Detect

Error on 2.3.0.2 after installing version 1.2.1.

Fatal error: Cannot declare class Mobile_Detect, because the name is already in use in /system/library/Mobile_Detect/Mobile_Detect.php on line 23

Error installing on 3.0.3.2 with Journal theme

Fatal error: Uncaught ArgumentCountError: Too few arguments to function Template::__construct(), 1 passed in /home/centvit/public_html/admin/controller/extension/module/lscache.php on line 301 and exactly 2 expected in /system/library/template.php:24

This is the error i get after installing the module with ocmod, and then go to Modules > LiteSpeed Cache and hit the + button.

Exceed php memory limit by crawler on huge number of products

in Opencart by default are THREE path to product page:

  1. only product_id path: /index.php?route=product/product**&product_id**=41
  2. by category_id (categoy path) /index.php?route=product/product**&path=20_27**&product_id=41
  3. by manufacturer_id : /index.php?route=product/product**&manufacturer_id**=8&product_id=41

crawler algorithm contain 1 and 2, path 3 (by manufacturer_id) forgotten!

on huge number of products, for example, more than 6000, array urls() exceed php memory limit and crawler stop!

that's why I replace in

catalog/controller/extension/module/lscache.php

echo 'recache product urls...' . ($cli ? '' : '<br>') . PHP_EOL;
        foreach ($this->model_catalog_product->getProducts() as $result) {
            foreach ($this->model_catalog_product->getCategories($result['product_id']) as $category) {
                if (isset($categoryPath[$category['category_id']])) {
                    $urls[] = $this->url->link('product/product', 'path=' . $categoryPath[$category['category_id']] . '&product_id=' . $result['product_id']);
                }
            }
            $urls[] = $this->url->link('product/product', 'product_id=' . $result['product_id']);
        }

        $this->crawlUrls($urls, $cli);

by this:

 echo 'recache product urls...' . ($cli ? '' : '<br>') . PHP_EOL;
        $UrlsCount = 0;
        $UrlsCountCount = 0;
        $this->load->model('catalog/manufacturer');
        foreach ($this->model_catalog_product->getProducts() as $result) {
            foreach ($this->model_catalog_product->getCategories($result['product_id']) as $category) {
                if(isset( $categoryPath[$category['category_id']] )){
                    $urls[] = $this->url->link('product/product', 'path=' . $categoryPath[$category['category_id']] . '&product_id=' . $result['product_id']);
                    $UrlsCount++;
                }
            }
            $urls[] = $this->url->link('product/product', 'manufacturer_id=' . $result['manufacturer_id'] . '&product_id=' . $result['product_id']);
            $UrlsCount++;

            $urls[] = $this->url->link('product/product', 'product_id=' . $result['product_id']);
            $UrlsCount++;

            if ( $UrlsCount > 4096 ) {
                $UrlsCountCount++;
                echo 'recache '. $UrlsCountCount . ' part of product urls...' . ($cli ? '' : '<br>') . PHP_EOL;
                $this->crawlUrls($urls, $cli);
                $urls = array();
                $UrlsCount = 0;
            }
        }
        echo 'recache '. $UrlsCountCount . ' part of product urls...' . ($cli ? '' : '<br>') . PHP_EOL;
        $this->crawlUrls($urls, $cli);

/admin/model/extension/module/lscache.php information/contact include or exclude?!?!

at file 3.0/upload/admin/model/extension/module/lscache.php

line 239:
$this->db->query(" insert into " . DB_PREFIX . "setting (store_id, code, key, value, serialized) values ('0', 'module_lscache', 'page_information_contact', '{"name":"Contact Us","route":"information\/contact","cacheLogout":"1","cacheLogin":"1", "default":"1"}', '1')" ) ;

information/contact include to LSCache

but at line 277:
$excludeRoutes = array(
......
'information/contact',
......

information/contact excluded from routes that cached.

Journal Product QuickView popup not cached by standard algorithm

Journal have Product QuickView popup feature.

after full site recache by crawler, QuickView popup become "very slow view", because product link open more faster than quickview popoup.

in /catalog/controller/extension/module/lscache.php
to cache Product QuickView popup need to add:

if (defined('JOURNAL3_ACTIVE')) {
$urls[] = $this->url->link('journal3/product', 'product_id=' . $result['product_id'] . '&popup=quickview');
}

some mistypes in language file

3.0/upload/admin/language/en-gb/extension/module/lscache.php

$_['entry_vary_login'] = 'Sep_e_rate View for Logged-in Users';

must be

$_['entry_vary_login'] = 'Separate View for Logged-in Users';

$_['help_purge_category'] = 'Purge Product Category cache after saving an Product';

may be must

$_['help_purge_category'] = 'Purge Product Category cache after saving a Product';

or better

$_['help_purge_category'] = 'Purge Product Category cache after saving Product';
?????

Issue - Add to cart success alert message is cached and displayed in account page, and few other irrelevant pages

Hello LiteSpeed Team,

Your plugin improves the OpenCart website performance to a great extent. Just a few issues alone

Issue with Basel theme - Add to cart success alert message is cached and displayed on the account page and a few other irrelevant pages. Please refer to this attachment

LiteSpeed_Cache_Issue

OpenCart Version - 3.0.3.8 (https://github.com/opencart/opencart/tree/3.0.x.x_Maintenance)
PHP Version - 8.1
LiteSpeed Plugin Used - https://github.com/litespeedtech/lscache-opencart/tree/master/3.0/upload

Kindly can you fix this Issue

Also, can you kindly add support for this theme (https://themeforest.net/item/basel-ajax-driven-opencart-theme/20199321) similar to the Journal theme

Thanks

Notice: Undefined index: language /extension/module/lscache.php on line 334

OpenCart 3.0.3.2

Fresh installation, default store.
Installed "lscache-opencart3.0-V1.3.0.ocmod.zip" with default settings.

Along the top of the frontend I see this error.

Notice: Undefined index: language in /data/redacted/domains/redacted.com/public_html/opencart/catalog/controller/extension/module/lscache.php on line 334

and

Notice: Undefined index: language in /data/redacted/domains/redacted.com/public_html/opencart/catalog/controller/extension/module/lscache.php on line 335

Multi-Store Issue / Feature Suggestion

Hi,

I've just upgraded to the latest version from a very old one and the improvements are fantastic. However, I have an issue. I use OpenCart because it has multi-store options.

I ran the recache function and it awesome that you can see what pages are being cached. But, once it scanned and cached the default store it stopped. Only the default store was re-cached.

Was it an oversight not to include code to check for additional stores?

Should it have re-cached my other stores but failed?

My suggestion is simple.

FEATURE SUGGESTION: Allow the user to select which store they want to recache and which store to purge.

My main store has a huge catalogue, my the other store are small and more focused on one niche. To recache all stores because you have made a change on one of them is a long, slow and needless process. Likewise, why purge everything?

Feedback back on my suggestion would be most welcome.

Is the only workaround to use the cURL function? Some help would be great.

Thanks,
Midge

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.