keycdn / cache-enabler

A lightweight caching plugin for WordPress that makes your website faster by generating static HTML files.
https://wordpress.org/plugins/cache-enabler/
123 stars 46 forks source link

update getting cache file #256

Closed coreykn closed 3 years ago

coreykn commented 3 years ago

Update getting the cache file by having the Cache_Enabler_Disk::get_cache_file() method set a property for the cache file path that has been generated. This will prevent having to build the file path again when a cached page is created after failing to be delivered.

I did not test it but I believe this will fix what was occurring in https://wordpress.org/support/topic/event-archive-cached-as-home-page/ (it may no longer be an issue as that plugin had changes made to address this issue recently). This would be due to now only using the file path to a cached page based on the originating $_SERVER['REQUEST_URI'] instead of checking this value again after the output buffering has ended (where in that time it could have been overwritten).

This updates what was added in PR #211.

coreykn commented 3 years ago

I did not test it but I believe this will fix what was occurring in https://wordpress.org/support/topic/event-archive-cached-as-home-page/ (it may no longer be an issue as that plugin had changes made to address this issue recently).

It did indeed fix that issue on our end: https://wordpress.org/support/topic/event-archive-cached-as-home-page/#post-14765936