pluginkollektiv / cachify

Smart but efficient cache solution for WordPress. Use DB, HDD, APC or Memcached for storing your blog pages. Make WordPress faster!
https://wordpress.org/plugins/cachify/
GNU General Public License v2.0
99 stars 31 forks source link

URL with port number leads to issue with cache removal #250

Closed florianbrinkmann closed 2 years ago

florianbrinkmann commented 2 years ago

Describe the bug I am using localhost with different port numbers for local development and just noticed that removing a cache by URL does not work. The reason for this is that the port is part of the string that is hashed when a new cache transient is created. But when the transient is searched to remove it, it looks for the hash generated from a string without the port.

To Reproduce Steps to reproduce the behavior:

  1. Use a domain with a port number.
  2. Fill the cache for a post.
  3. Add a comment to the post and approve it.
  4. Now, when not being logged in, the comment should not be visible because the cached version is loaded.
stklcode commented 2 years ago

I'd agree with @krafit to schedule this issue and the corresponding fix for the next point release. Guess this primarily affects test/dev environments and maybe some rare proxy/container scenario where the visible URL is not remapped to a default port.

If there are other reasons we might backport it to a 2.3.x bugfix release.