EE redis / php7 small cache times


#1

Hello rtCommunity and rtCamp,

If we have a site that is --wpredis --php7

what config files would I need to update and what settings to shorten object and page cache times; i.e perhaps microcaching to 1-5 minutes. The site is quite dynamic and nginx-helper does not seem to be flushing things on post update, esp things like genesis framework page / post widgets (which may be the object cache).

Note I have made the customisation per https://miteshshah.github.io/linux/nginx/how-to-setup-separate-nginx-fastcgi-cache-for-mobile-and-desktop-users/ but for redis / php7 to handle soliloquy and mobile / desktop if that matters.

As the config files are spread over many places and we may go back and fourth between redis and wpfc what config files etc do I need to update to lower the cache lifetimes of object cache and full page cache - for both redis and wpfc (we prefer redis, but if not possible will fall back to wpfc)

We’re thinking 5 minutes is a good time frame but it could go lower so there might need to be some ‘queue’ lock / limit type things to prevent spikes to WP when rebuilding caches - there’s various tutorials out there, but they’re all for home grown nginx / wpfc / redis configs and not EE world. We’d love to know how to accomplish a more micro or lower cache time in EE

And perhaps know why nginx-helper does not seem to clear certain things upon page or post update.

Note, server hosts multiple sites under ee, perhaps we need to change the nginx-helper cache prefix?

We’ve experimented with wp-rocket without page caching enabled to get minifaction, dns prefetch, lazy load, etc and this works fine with redis full page cache and object cache per nginx logging stamps (although unclear in this scenario if we need to set the wp-config cache true off - as some posting on here seem to indicate that is not needed when using redis page cache / and or delete wp-rockets advanced-cache.php - they have a plugin to disable page cache which I believe does turn the wp-config setting off and remove advanced-cache.php but we can also install the plugin, update wp-config and delete the advanced-cache.php by hand if required)

We’re also sending PHP Sessions to Redis due to some plugins using them.

The server is a two core two gig ram on aws and within the last month or so we’ve seen huge CPU usage when it rarely had any before; not sure what has changed as traffic patterns have not (other than some aggressive bot crawlers which we block with 444s before they even hit WP)

Cheers, and thank you.

wondering if it is /etc/nginx/conf.d/fastcgi.conf for the page cache times? or another file? Or we have /etc/nginx/common/redis-php7.conf

where block is

location /redis-store {
internal  ;
set_unescape_uri $key $arg_key ;
redis2_query  set $key $echo_request_body;
redis2_query expire $key 14400;
redis2_pass  redis;

}

Does the 14400 need to change as well? Or are we chasing the wrong files / settings.


#2