• Resolved Philip Faster

    (@philipfaster)


    Hi,

    When the page is loading for the first time, wp Quicklatex plugin will convert latex into PNG&SVG images, and txt in ql-cache. The number of images depends on the number of latex embedded objects (one each /[…/]).

    Then, when we change some new commands and include additional packages in the advanced setting (for the whole website), then I saw something wrong (in my opinion).

    WP QUicklatex will re-create all the images for each loaded page. BUT, the old images are not deleted, so I have multiple PNG and SVG images for each embedded latex object.

    Is this intentional?
    If not, maybe this could be another idea to optimize the website space. because maybe some websites have thousands equation and always increases. and it will be doubled for each additional package or modification.

    For now, I have to delete all images inside ql-cache, manually, after package modification.

    best regards,

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author advanpix

    (@advanpix)

    This is intentional and optimized for speed. Space is almost never a concern for website, but speed is.

    If you remove the package later on – then all formulas won’t be regenerated since all of them are already in the cache. QuickLaTeX cannot know in advance if you will change some formula (or revert it back after changes) and it keeps all versions of the formulas.

    If you don’t need all the formulas anymore – than you need to clear cache manually.

    Thread Starter Philip Faster

    (@philipfaster)

    Oh I see,
    That makes sense
    thanks for the explanation…

    Plugin Author advanpix

    (@advanpix)

    Thank you for the 5-star review.

    Thread Starter Philip Faster

    (@philipfaster)

    Hi,

    I already try this:

    If you remove the package later on – then all formulas won’t be regenerated since all of them are already in the cache.

    Precondition:
    I have an additional package, which is {cancel}, and all images already generated

    Test 1:
    1. remove all cache images in ql-cache
    2. revert back to default packages (remove my additional package)
    3. reload the post page and the new images are generated by the plugin (this is good)

    Test 2:
    1. after test 1 point 3, I didn’t remove the generated cache
    2. add my additional packages back to setting
    3. reload the post page, and images loaded from cache (this is also good)

    Test 3:
    1. after test 2 point 3, I remove the generated cache, again.
    2. revert back to default packages
    3. reload the post page, and the new images are re-generated by the plugin (this is good)

    So, “then all formulas won’t be regenerated since all of them are already in the cache.” contradicts with my test 1 and 3…
    But the impact for deleting cache will slow down the “first loading pages with latex” because it needs to re-generate the images in those pages..

    Maybe for future updates, you can add it in setting, whether user want to purge all the cache when packages are changed..
    just my opinion..

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘ql-cache is not removing unused images’ is closed to new replies.