Preload Cache for thousands of posts may be on non-production environment

by Deepak Bansal   Last Updated June 17, 2018 21:08 PM

I have a setup of three wordpress environments:

  • Local: My Development machine (using docker)
  • Staging: An AWS Free Tier EC2 machine
  • Production: An AWS Free Tier EC2 machine

I use git/git-hooks to version control and deploy my code from local to staging to production. Similar to as mentioned here.

My website is affiliation based, product comparison site. I am using this price comparison theme to upload and show products (which are actually posts).

Currently I have more than a hundred thousands products uploaded. Obviously, without any caching, the site is taking huge time to load (around 10 seconds per page).

So I reckon using a caching plugin like W3 Total Cache or WpFastestCache plugin to preload the product and listing pages would help here.

However I am facing two problems here:

  1. Where to install cache plugin, because it deals with disk files. and I can not put all the cached pages under version control by installing the plugin on all 3 environments for obvious reasons.
  2. Second, how to generate preloaded cache files for so many pages with current set of resources available (AWS Free Tier machines). The plugin recommends 10 pages per batch which would take years to preload all the pages.

For the second problem, I hope something outside of the plugin might help. Or if by any chance I can generate the page caches on my local machine which is heavy enough (16 GB RAM, 8 core). The problem I can see using this approach is if the generated pages would be using localhost instead of my production website url inside their content.

Related Questions

String Replace Caching & Chance of Collisions

Updated June 09, 2015 23:03 PM

Extremely slow Wordpress website with 6000 posts

Updated May 04, 2017 10:08 AM

w3tc combines and adds javascript/css twice

Updated June 17, 2017 00:08 AM