How to configure file based cache for WordPress websites

Hi,
Since Cleavr is powered with NGINX we need to add some rewrites for WordPress Cache plugins.

Is there any information available for using WP Rocket or WP Super Cache?
I’m looking for examples serve the cached files just like you do with mod_rewrite (Apache).
Besides this, is there some information that describes how to customize your NGINX configuration for a single website?

Hi @finalwebsites, welcome to the Cleavr forum!

Here is a resource WP Rocket provides with some tips working with NGINX https://docs.wp-rocket.me/article/37-nginx-configuration-for-wp-rocket and includes a link to a project that looks to deep dive into config settings even more - https://github.com/SatelliteWP/rocket-nginx.

For modifying NGINX settings in Cleavr. There is currently server level configs you can add via server > services > NGINX settings (wrench icon). The same is available for PHP.

If you choose to use FastCGI, you can enable that for a site and modify settings from Cleavr.

For modifying NGINX settings at the site level - this is something we’re planning on adding very soon. But, in the mean time, can be modified on server via SSH or SFTP.

For example, a common task might be to tweak cache settings for images -

  1. SSH into server (I like SSH and console commands as it feels quicker, but file locations will be same for SFTP)
  2. Navigate to NGINX configs - cd /etc/nginx/sites-available
  3. Then you can view the current sites set up via command ls -alt
  4. To edit a site’s settings using vim, vim <sitename>

Then you can edit accordingly -

location ~* \.(gif|jpg|jpeg|png|css|js|svg)$ {
        expires max;
        access_log off;
    }

The above is just a generic example to show you where the site level configs are.

I hope that helps!


Here are some guides on accessing Cleavr managed servers that may be helpful -

Hi Adam,
thanks for the information. This is actually not what I’m looking for. File based cache is an important feature for most WordPress sites. If you host your website on a server which is based on NGYNX, it’s not a standard configuration.
Example configurations are very helpful here.

I know this information enough to avoid it. Installing some script to create your NGINX config file? Sounds quick and dirty to me.

My post here is not to “push” a new feature into Cleavr, but a suggestion to create a better documentation than others have. I’m sure many people avoid using NGYNX based servers because their (cache) plugins doesn’t work very well.