Redis and varnish cache with woo-commerce


#1

We have 1 server running 2 applications with the following setup:

  1. Example.com + Example.com/blog (Both wordpess installs with blog being in sub-direcotory)
  2. Example2.com (woocommerce)+ Example2.com/blog (sub-directory wordpress)

We use REDIS as both object and database cache for all 4 wordpress installations along with Varnish cache:

Before implementing the setup we had the following questions:

  1. Since application settings such as varnish are going to be shared with the sub-directory, how do we control the varnish settings individually for the sub-directory app? Eg, if we switch off varnish for main app, then sub-directory app loses varnish too?
  2. PHP settings: How do we selectively increase or decrease php memory limit of sub-directory apps?
  3. If we exclude cookies and urls in varnish settings in main app, then are these settings shared by sub-directory apps too?
    In essence, how do we control the isolation of 2 apps in cloudways?

Redis specific questions with woo-commerce :

  1. Can you please confirm that redis settings are server specific and NOT application specific.
  2. In the kb http://www.cloudways.com/blog/install-redis-cache-wordpress/ it is mentioned that with W3tc, we need to only choose Redis and it works out of the box. Do you think that is all?

For method 2 in the KB, the wp-config file is recommended to have an unique salt and key value such that multiple apps can use redis without conflict and we believe this should be done in our setup. Will sub-directory apps need additional settings or as long as each website has its own unique salt and key-values everything will work fine? Please confirm the need to tweak the wp-config file.

  1. Do we need to make WP_REDIS_SELECTIVE_FLUSH as TRUE in WP-CONFIG.PHP . According to Tillkruss plugin description that seems to flush only Redis cache that matches the SALT cache key of that one Wordpress app (not the entire Redis cache on server). Can you please confirm this as an absolute need to avoid conflicts and enhance performance as selective flush will enhance speed for all apps using redis.

  2. Do we need to name the tables differently for redis to work? Ie. chage wp_ to unique (good for security + maybe redis?)

  3. Can you please confirm that redis settings can be configured only for the whole server and not application specific?

  4. Do we need to do anything else for multiple woocommerce/wordpress apps to run sumulteniouly for redis to work?

  5. Can 2 woocommerce installs run at the same time in 1 server all using redis as both object and database cache (OR 1 as main app and the other in the sub-directory)? How to avoid conflicts in such a case?

  6. Does anyone have experience to highlight issues in using redis as both object and database cache in woocommerce and multiple wordpress installs running in the same server and in sub-directories (our structure mentioned in the beginning)?

  7. Are any woocommerce specific settings required for using Redis from your experience?

Cloudways needs woo-commerce specific KBs urgently to implement Redis and Varnish. Specifically, if multiple wordpress/woo-commerce installs are run in 1 server and in sub-directories. We intend to capture the information form this discussion and convert it into a detailed and logical article for the rest of the users in cloudways.

Thanks a ton in advance :slight_smile:

Best,


#2

Little setup is needed. Ask the Chat Support guys to add the WooCommerce Varnish Rules on your Application(s). Then go to work :slight_smile:


#3

All is simple as long as 1 application is running :wink: To share a cache system among multiple applications need a bit of tweaking :wink: We will positively ask the support as the community post did not get us an insight yet. Thanks a lot for pitching in.


#4

Well that dependes. When your only application is a Multi Network Install (by now with 10+ domains/sites running), things tend to get a bit more complicated. Varnish Rules are Applicaion-Wide, what means that each Application needs to have them added. Hope it helps, cheers!