Amazon EC2 and static page Caching (Multisite): How to enable Caching with multiple instances?

Depending on the current load, Amazon EC2 may spawn multiple server instances of a well visited WordPress website (files are duplicated, while database is the same for all). For this WordPress website I want to enable static page caching.

The problem obviously is that almost every caching plugins store the cached within the server instance. If there are multiple instances the cache folder can not be shared on Amazon EC2 (https://serverfault.com/questions/646293/shared-file-systems-between-multiple-aws-ec2-instances).

Does anybody have experience with this topic? Is there a possibility to do static file caching within the database? Or how do you scale WordPress to multiple instances and solve the caching problem? I have looked for Plugins to solve this but no result :-/

Topic amazon scale multisite cache Wordpress

Category Web


There are two alternatives

  1. store the caching on an NFS "drive"
  2. put a caching proxy before your instances and forget about stupid caching plugins.

Variation on 2 is to use a CDN like cloudflair to do the caching.


I have noticed that on WP Super Cache, with Redis Object Cache enabled, the experimental feature "Object Cache" (instead of file caching) is available.

I tested it but the timestamp checks failed, don't know if they are supposed to (it happens also when CloudFlare is enabled with HTML minification and is considered normal).

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.