Set up Swift Performance Cache with Optimus Prime in Local Mode

Optimus Prime is a cache warmer to load web pages faster on initial load by querying all pages on a websites sitemap via the sitemap URL, it works in harmony with a cache plugin preloading tool.

Optimus Prime also has a local mode in which it checks the local cache folder for cached relative URLs and only fetches whats missing from the sitemap URL, this speeds up the cache priming process but is only possible if the cache plugin stores its cached pages in folders named relative to the original URL – plugins like W3 Total Cache, WP Super Cache and WP Fastest Cache also so does Swift Performance.

First up is to install and set up Opimus Prime on your server then run the command from the server or better yet set up a cron job.

Running Optimus Prime in local mode with Swift Performance

/home/mysite/ocp/ocp -l /home/mysite/public_html/wp-content/cache/swift-performance/mysite.com https://mysite.com/sitemap.xml

So run the above command for Optimus Prime with a parameter of ‘-l’ to prime the cache folder ‘mysite.com’ which is where the relative URLs are stored as folders, change the path names and URLs in the command to suit.

Run as a Cron command

Use the same command in a cron job

Swift Performance Optimus Prime Cache

Here I have set the command to run every 15mins.

Leave all Comment