rtCamp / nginx-helper

Nginx Helper for WordPress caching, permalinks & efficient file handling in multisite
https://wordpress.org/plugins/nginx-helper/
229 stars 121 forks source link

Add option to allow preloading cache. #355

Open Vedant-Gandhi opened 1 week ago

Vedant-Gandhi commented 1 week ago

Description

The aim of this PR is to allow addition of preloading the cache.

Type

Reference Issue

Testing

The code has been tested locally and is working as expected.

To Test the functionality -

  1. Go to Nginx Helper page in the Settings.
  2. Now select the checkbox for Preload Cache and Save.
  3. Once the page reloads all the pages and posts ( which are available in sitemap.xml) will be cached.
  4. You can test any Page/Post to determine if it is cached or not.
  5. To determine if the Page is cached or not we can do the following - a. Check if the timestamp generated by nginx timestamp has the queries executed as 1. b. Manually check in Redis if there are keys starting with prefix set for nginx helper in admin page. c. The timestamp in the HTML changes during each refresh so it is not reliable to determine if the page is cached or not.