Lite Cache
[resolved] Paginated comment pages aren't cleared/purged (4 posts)

  1. jumbo
    Posted 1 year ago #

    Thanks for the plugin. I noticed that post comment pagination pages aren't cleared during the typical necessary routines. For instance, let's say there was the following blog post
    and a comment is added, edited, approved, disapproved. Lite Cache will properly clear the first page, but it won't clear any of the following:


    Since you're using a directory structure for caching, wouldn't it make sense to simply delete the single blog post folder (e.g., hello), which will cascade and delete any paginated items? Like a recursive delete?

    Otherwise, with the cache's existing logic, it doesn't look like comment pagination caches would be deleted under any circumstance, short of scheduled garbage collection.



  2. Stefano Lissa
    Plugin Author

    Posted 1 year ago #

    Yes, the post related folder is deleted. If not there is some kind of problem in your installation.

  3. jumbo
    Posted 1 year ago #

    Stefano, thanks for responding. I was testing on a windows environment, and it wasn't working. I took a look at the remove_dir() function and I think I found where the problem is. You have the following:

    if (substr($file, -1) == '/')

    The problem is, that particular code assumes the directory separator is a forward slash, but on Windows, it's a backslash. So Lite Cache will think every directory is a file.

    Replacing the above with the following fixes the recursive delete operation:

    if (substr($file, -1) == DIRECTORY_SEPARATOR)

    But you also have hard-coded references to '/' throughout the code that assumes a non-Windows environment.

  4. Stefano Lissa
    Plugin Author

    Posted 1 year ago #

    Fixed. Actually PHP as other multi-os system correctly manages the / as separator, but not for the glob function... :-(

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Lite Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.