Post by SapporoGuy » Wed Feb 02, 2011 12:21 am

I was wondering why APC wasn't used as cacheing solution for opencart.
Any reasons why not to?

930sc ... because it is fun!


User avatar
Active Member

Posts

Joined
Mon Nov 01, 2010 7:29 pm

Post by JAY6390 » Wed Feb 02, 2011 11:42 pm

Not everyone has APC on their server, and to require it is going to limit some people to cache their categories etc. Not really ideal for a shopping cart, and while I understand the benefit of using APC you'd be in a minority as to who can use it. Most shared servers won't allow/have it installed or enabled, which would be a nightmare for those that want to use caching

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by SapporoGuy » Thu Feb 03, 2011 12:48 am

I had a feeling that availability would be an issue. (memcache will be the same then too)

I'm trying to come up with a way to boost what is being offered in opencart at the moment since the current class seemed like it could use some help.

Also, was looking forward to the future when php6 rolls out.

Do you have any ideas or suggestions?

930sc ... because it is fun!


User avatar
Active Member

Posts

Joined
Mon Nov 01, 2010 7:29 pm

Post by carlmartin » Wed Jul 06, 2011 7:29 pm

Hi,


I have updated the chache.php file top use APC cache if apc is available for the application.

Code: Select all

public function get($key) {
        if (extension_loaded('apc')) {
                return apc_fetch(HTTP_SERVER.$key);
        }
else {
// old get code goes here
}
}

public function set($key, $value) {
        if (extension_loaded('apc')) {
                apc_store(HTTP_SERVER.$key,$value,600);
        }
else {
// old set code goes here
}
}

public function delete($key) {
  if (extension_loaded('apc')) {
                apc_delete(HTTP_SERVER.$key);
        }
else {
// old delete code goes here
}
}
To my experience this greatly improves the performance of your opencart installation.

Other improvements can be made if storing more sql results in cache bigger changes needs to be done, however.

/regards

Martin

Newbie

Posts

Joined
Tue Jan 12, 2010 11:53 pm

Post by edushyant » Tue May 01, 2012 7:27 am

Hello Martin,

Can you post full cache.php file with apc settings.
I cant seem to get it working.
I am on cheap unmanaged vps running opencart on ngnix (with page load speed of around 2 sec)
I have made some changes to my.cnf for mysql.
What are minify options for OpenCart?

Many thanks in advance

Newbie

Posts

Joined
Tue May 01, 2012 1:44 am

Post by zstergios » Tue Mar 19, 2019 1:17 am

You can try my solution for Opencart v1.5
https://github.com/zstergios/Opencart-1.5-APCU-CACHING

Also includes vqmod for engitron / nginix /varnish compatibility that works on all opencart versions

Newbie

Posts

Joined
Tue Mar 19, 2019 1:15 am
Who is online

Users browsing this forum: No registered users and 34 guests