Title: LSC plugin compatibility
Last modified: January 27, 2026

---

# LSC plugin compatibility

 *  [litetim](https://wordpress.org/support/users/litetim/)
 * (@litetim)
 * [2 months, 1 week ago](https://wordpress.org/support/topic/lsc-plugin-compatibility/)
 * Hello
   I am part of Litespeed Cache plugin team.We are working on some changes
   to our plugin and we are testing the changes for compatiblity with other plugins.
   We debugged a situation that is happening when your plugin enabled. We narrow
   down to function: **litespeedReset($post_id)** in **/classes/cache.php**The action
   added is **litespeed_media_reset**. That is doing more than clearing cache, it
   clears LSC meta data and image that is added to optimization queue. Let’s try
   changing to **do_action( ‘litespeed_purge_all’ )**

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Pedro](https://wordpress.org/support/users/petredobrescu/)
 * (@petredobrescu)
 * [2 months, 1 week ago](https://wordpress.org/support/topic/lsc-plugin-compatibility/#post-18799676)
 * Hello [@litetim](https://wordpress.org/support/users/litetim/) and thanks for
   getting in touch!
 * > The action added is litespeed_media_reset. That is doing more than clearing
   > cache, it clears LSC meta data and image that is added to optimization queue.
 * This is actually the reason why we chose this action. Considering that our plugin
   replaces the image with a completely new one, the associated meta data is obsolete(
   since it was for the previous image) and the new image should be added to the
   optimization queue, so it is optimized again, won’t you agree with this?
 * Thanks
 *  Thread Starter [litetim](https://wordpress.org/support/users/litetim/)
 * (@litetim)
 * [2 months, 1 week ago](https://wordpress.org/support/topic/lsc-plugin-compatibility/#post-18799908)
 * [@petredobrescu](https://wordpress.org/support/users/petredobrescu/) 
   I agree
   🙂 Nothing to add there.Can clean up run before making the changes?Hooks like:**
   wp_update_attachment_metadata** or **wp_generate_attachment_metadata** will use
   new main image uploaded/renamed. Right?
 *  Plugin Author [Pedro](https://wordpress.org/support/users/petredobrescu/)
 * (@petredobrescu)
 * [2 months, 1 week ago](https://wordpress.org/support/topic/lsc-plugin-compatibility/#post-18803945)
 * hello [@litetim](https://wordpress.org/support/users/litetim/),
 * We are already [using both of them](https://github.com/short-pixel-optimizer/enable-media-replace/blob/master/classes/Controller/ReplaceController.php#L194-L197)
   🙂
 * Maybe it would be easier if you could tell us what are the issues you are facing
   and we’ll do our best to reproduce them and get them fixed with your help. Are
   there situations when the replacement doesn’t work as expected, or what is going
   on?
 * Thanks
 *  Thread Starter [litetim](https://wordpress.org/support/users/litetim/)
 * (@litetim)
 * [2 months, 1 week ago](https://wordpress.org/support/topic/lsc-plugin-compatibility/#post-18804342)
 * [@petredobrescu](https://wordpress.org/support/users/petredobrescu/)
 * We are working on changes, They are found on our **dev** branch.
   You can install
   this test version from LSC => Toolbox => Beta test, click on **Use latest GitHub
   Dev commit** and click on Ugrade.Enable **image optimization** and set to format
   to WEBP or AVIF. Also make sure: [https://docs.litespeedtech.com/lscache/lscwp/imageopt/#auto-request-cron](https://docs.litespeedtech.com/lscache/lscwp/imageopt/#auto-request-cron)
   is **ON**Upload a image to media, Check database, table: **litespeed_img_optming**
   to see if image(and subsizes) were added for optimization.When doing replacement:–
   while image is uploading and is being processed: image and sizes are added in
   the optimization table– AFTER all hooks terminated running there is the action:**
   litespeed_media_reset** that run. This action will reset all LSC data created
   and remove the image from queue( Code is here: [https://github.com/litespeedtech/lscache_wp/blob/dev/src/media.cls.php#L252](https://github.com/litespeedtech/lscache_wp/blob/dev/src/media.cls.php#L252))
   If you are more confortable: we have a slack workspace where we can talk directly
   [https://www.litespeedtech.com/slack](https://www.litespeedtech.com/slack)
 *  Plugin Author [Pedro](https://wordpress.org/support/users/petredobrescu/)
 * (@petredobrescu)
 * [1 month ago](https://wordpress.org/support/topic/lsc-plugin-compatibility/#post-18839157)
 * [@litetim](https://wordpress.org/support/users/litetim/) I understand now the
   issue.
 * What would be your suggestion? What can we use instead of `<strong>litespeed_media_reset
   </strong>` to clear all caches without removing the image from the plugin’s optimization
   queue? Should we fire this action earlier, before the image is added to the queue?
   Would you be able to add the image to the queue later, so the `<strong>litespeed_media_reset
   </strong>` action is already finished?
 *  Thread Starter [litetim](https://wordpress.org/support/users/litetim/)
 * (@litetim)
 * [1 month ago](https://wordpress.org/support/topic/lsc-plugin-compatibility/#post-18839399)
 * [@petredobrescu](https://wordpress.org/support/users/petredobrescu/) Let’s try
   changing **litespeed_media_reset** to **do_action( ‘litespeed_purge_all’ )**

Viewing 6 replies - 1 through 6 (of 6 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Flsc-plugin-compatibility%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/enable-media-replace/assets/icon-256x256.png?rev=1940728)
 * [Enable Media Replace](https://wordpress.org/plugins/enable-media-replace/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/enable-media-replace/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/enable-media-replace/)
 * [Active Topics](https://wordpress.org/support/plugin/enable-media-replace/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/enable-media-replace/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/enable-media-replace/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [litetim](https://wordpress.org/support/users/litetim/)
 * Last activity: [1 month ago](https://wordpress.org/support/topic/lsc-plugin-compatibility/#post-18839399)
 * Status: not resolved