Caching & Website Speed

Website Speed is essential for a good user experience. That’s why Donation Platform for WooCommerce gets by with less than 10kB of CSS & JS files, and only loads them when necessary.
However, WooCommerce and WooCommerce extensions each add overhead to your website.

In the context of Donation Platform for WooCommerce, there are a few things to keep in mind when using caching plugins.
Donation Platform for WooCommerce uses WordPress nonces to verify requests and avoid CSRF issues. These nonces have a lifetime of one day. If you enable caching that caches HTML pages for longer than one day, the nonces become invalid and potential donors get error messages. With a shorter cache time the problem can generally be solved.
Feel free to share your experiences about different cache & site optimizer plugins with me.

Optimizing Display Performance with Cached Progress Bar and Donation Leaderboard Data

Donation Platform for WooCommerce employs a caching mechanism for both the donation leaderboard data and progress bar data, significantly enhancing loading times. However, this may lead to a delay in displaying newly made donations. To address this, you have the option to manually purge the cache by selecting the “delete cache” checkbox within the plugin’s settings.

Alternatively, you can opt to wait for a natural cache expiration, which typically takes a couple of hours. To ensure a transparent user experience, it is advisable to communicate to your users that new donations might not be immediately reflected in the progress bar and donation leaderboard. This proactive approach sets clear expectations and enhances the overall user engagement with the donation platform.

Troubleshooting Nonce Verification Issues

1. Use a Shorter Cache Time

To prevent nonces from expiring, configure your caching plugin to use a shorter cache time. Ideally, set the cache expiration time to something like 4 hours. This can help avoid nonce-related errors during the donation process.

2. Disable Cache for Affected Pages

If you are experiencing nonce verification failures on specific pages, consider disabling caching for those pages. Most caching plugins allow you to exclude specific URLs or pages from caching. By excluding donation-related pages from caching, you can ensure that nonces remain valid and donations process smoothly.

3. Consider a Different Caching Plugin

If you continue to encounter nonce verification issues despite making adjustments to your current caching plugin, consider trying a different caching plugin. Not all caching plugins behave the same way, and switching to one that is more compatible with WooCommerce and Donation Platform for WooCommerce may resolve the problem.

4. Use Cache Purging

Some caching plugins offer cache purging options, allowing you to clear the cache manually or automatically when specific events occur, such as product updates or new donations. By implementing cache purging, you can ensure that the cache is always up-to-date and that nonce issues are less likely to occur.