Page 1 of 1
APC cache
Posted: Wed Feb 02, 2011 12:21 am
by SapporoGuy
I was wondering why APC wasn't used as cacheing solution for opencart.
Any reasons why not to?
Re: APC cache
Posted: Wed Feb 02, 2011 11:42 pm
by JAY6390
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
Re: APC cache
Posted: Thu Feb 03, 2011 12:48 am
by SapporoGuy
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?
Re: APC cache
Posted: Wed Jul 06, 2011 7:29 pm
by carlmartin
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
Re: APC cache
Posted: Tue May 01, 2012 7:27 am
by edushyant
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
Re: APC cache
Posted: Tue Mar 19, 2019 1:17 am
by zstergios
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