Jump to content

APCu enabled - Backend caching problem


kuskov

Recommended Posts

Hi guys,


 


we use Prestashop 1.6.1.10 and we have a strange problem hapenning. When i activate APCu or Memcache(-d) Cache, we have very fast frontend, but we can't work in the backend.


 


For example, i go into one product and change the Meta Title. After i click save in the input field stands the old Meta Title, but in the database is the new Meta Title. When i after that disable APCu i refresh the form and see the right Meta Title.


 


Is there a way to somehow disable cache for backend? Or move backend to separate instance? What are the best practices there? Every time to turn off APCu when i change something in shop is impossible ...


 


Will be very thankful for you help!


 


Link to comment
Share on other sites

You might do a google search for apcu configuration and see if you can disable it for certain folders or scripts.  However I do not believe this will be possible, since both the front and back office are going to use the php scripts in the classes folder, which is more than likely where the caching is occurring.

 

Prestashop really should design their use of APCu better, and only use it where caching is truly required/desired.  I agree that caching in the back office does not make much sense, especially when cache is not being properly managed.

Link to comment
Share on other sites

  • 3 weeks later...

I have been having similar problems when using Memcached caching, although it's not consistent.  Some things can be changed and some can't.  It's very confusing.

 

I want my shop to run fast, but if my backend changes are inconsistently applied it makes a lot of work and confusion for me.

 

Did you ever find a way around this?

Edited by dobesv (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 5 months later...
  • 3 months later...

There are none. Disable cache or simply refresh cache after each time you made changes. 

The only alternative is to don't run these old php caching modules. Use php 5.6.30 with php-fpm and ngnix for to speed up your site. Take a look here on best server configuration using better php-versions based on opcache, don't needing these old php-cache modules (APC, memcache,xCache, etc.): https://www.prestashop.com/forums/topic/633856-server-requirements-tested-in-production-for-ps-16/

Link to comment
Share on other sites

  • 4 months later...

I vote Prestashop Legend down because the moderator does not read clearly the TITLE.
APC is outdated, that is right. When Zend OPcode came into the game, it is the better way to cache opcode, so APC became absolute.

Quote

APCu is a user database cache that PrestaShop can utilize to increase your site’s speed by caching database data. One thing to note, is that APC is no longer maintained and APCu is a different caching extension. APC used to cache Opcode and database data, but Opcache by Zend came out and did away with APC, it was never upgraded to PHP 5.5 or later. APCu is all of the database caching mechanisms that were stripped out of the APC module. This means that APCu was designed to work alongside Opcache to provide even better performance.


There is a prestashop module that is promising for APCu, however only to monitor.

My setup currenly is to use a reverse proxy to my appserver. I spawn a second PHP-FPM process for the admin backend.
Doing so I can tweak with php_admin_value the cache settings.

I do notice prestashop needs additional steps to change their code to optimize the use of APCu in the performance tab and
using it properly with their Symphony framework. Work to do for them !
 

ZendOpcode AND APCu is mandatory when you have a huge website.


Import to read (based on old php version BUT STILL VALID AND IMPORTANT)

https://support.cloud.engineyard.com/hc/en-us/articles/205411888-PHP-Performance-I-Everything-You-Need-to-Know-About-OpCode-Caches

Some modules:

Zendcode OPcache:
https://dh42.com/free-prestashop-modules/prestashop-opcache-manger-module/


APCu:

https://dh42.com/free-prestashop-modules/apcu-manager/

 

Link to comment
Share on other sites

make sure you understand the differences between data caching and php script compile caching.  They are not the same thing

opcache is a php compiler caching system.  it does not deal with data caching.

data caching is used to cache data in memory (or other places like file systems), and APCu can still be used for that, in conjunction with opcache

this topic is about using APCu (or other data caching components) and its effect on the back office data.

  • Like 1
Link to comment
Share on other sites

  • 4 years later...

Is this post still applicable to the latest ps version ?

And if so, are these the only 2 caching modules that should be active on the server.

ie, what about the likes of mod_cache, mod_expires, nginx etc.

1550511821_Screenshot-2022-10-18-at-16-10-15-Module-Manager--North-West-Ecigs.jpg.d9524d54f7e4e2c7826c3c0528f2544d.jpg

I have just installed and activated APCu and in the ps module above, the start time is always showing as 1970/01/01

 

Is there a list anywhere of what Apache modules and php extensions should be installed on the server for the best prestashop performance.

Thanks

Edited by MerseyRay (see edit history)
Link to comment
Share on other sites

  • 4 weeks later...

@MerseyRay APCu is not good. It breaks stock managment. Product sold out, database shows quantity 0, but backoffice still loads initial value and front office still shows product as available for purchase. Customers get stock error only during order processing.

Of all cache options available in PS 1.7 only memcached is worth considering, because it's still maintained.

Link to comment
Share on other sites

On 11/12/2022 at 4:54 PM, Sharak said:

@MerseyRay APCu is not good. It breaks stock managment. Product sold out, database shows quantity 0, but backoffice still loads initial value and front office still shows product as available for purchase. Customers get stock error only during order processing.

Of all cache options available in PS 1.7 only memcached is worth considering, because it's still maintained.

Hi Sharak,

I have installed memcached, here is the phpinfo result

memcached-settings.png.53bcca7de399e77691f5f2aa6430e6ee.png

But when I try enabling it, I cannot successfully add a server configuration.

memcached.png.b19912384d9ead9cf8cd7589f4bc4b84.png

Any ideas?

Thanks

Edited by MerseyRay (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...
On 11/14/2022 at 6:12 AM, Mediacom87 said:

Hi,

All server caching solutions offered by PrestaShop have problems and should not be used.

Enabling opcache on your PHP version is interesting.

 

as mediacom87 mentioned, opache,  this works and is recommended.

The only other cache we have ever seen actually work is memcache.

if you are using a module for cache, we recommend uninstall it as it creates issues that if reported  you will not be able to re-produce.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...