• Resolved Mikey

    (@mikeyhash)


    Hi,

    For every optimized image, there is a litespeed-optimize-size line saved in the wp_postmeta table.

    I can see that this is used solely for showing the total savings in Media panel.

    However, can you please make changes and stop saving these in wp_postmeta table? Perhaps you could create a different database table for this purpose.

    The problem: for instance, we run a marketplace, which means that new products are being added every day, together with lots of pictures and thus we’re bloating our postmeta table with the litespeed-optimize-size lines.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi @mikeyhash, do you still wish to check the optimization information on media page? Or just want to reduce the post_meta size?

    Thread Starter Mikey

    (@mikeyhash)

    @stanleylitespeed, both ??

    Sure, I could remove the add/update_post_meta in the plugin’s file and get rid of the unpleasant post_meta on my own, but I am hoping for a different approach from you guys in order to better optimize this (creating a new table or something).

    Plugin Support Hai Zheng?

    (@hailite)

    Hi,

    This is a good question. Usually its a normal behavior to save meta data in wp_postmeta table.

    We will note this and try to improve it after v3.3.

    Thread Starter Mikey

    (@mikeyhash)

    @hailite, well, yes, everybody saves almost everything in wp_postmeta, because it’s the easiest way to go.

    But from a true, better, on-going performance perspective, I think a custom table should be used in this case.

    Thanks for noting that.

    • This reply was modified 5 years, 5 months ago by Mikey.
    • This reply was modified 5 years, 5 months ago by Mikey.
    Plugin Support Hai Zheng?

    (@hailite)

    Can’t agree more. To achieve that along with some other improvements for image optimization, we will do in a special version.

    Will update here once its done.

    Plugin Support Hai Zheng?

    (@hailite)

    Hi again,

    We are currently working on the scheduled image optimization coding. Regarding this concern, we found it will cause an additional new table and extra hooks when operating WP attachments (e.g. delete/update attachment).

    Also we will add another key-value to that record litespeed-optimize-size, which will mark if that image group is optimized or not.

    For now we will attach to that postmeta record. But will keep an eye on it to figure out potential improvement.

    Thread Starter Mikey

    (@mikeyhash)

    @hailite, thanks for the update.

    Let me know if I understand correctly:

    1) you are going to add a new table in db (for the scheduled image optimization).

    2) you are making litespeed-optimize-size postmeta a little bigger by adding one more element in the array.

    So, what’s wrong with adding 2 new tables? ??

    • This reply was modified 5 years, 5 months ago by Mikey.
    Plugin Support Hai Zheng?

    (@hailite)

    1) Not exactly. We won’t add new tables for now. Will still keep using the one wp_litespeed_img_optm even after we added the extra folder (outside of /upload) optimization feature.

    2) Correct. That is for faster scan feature to re-run the optimization for finished image groups which generated new size thumbnails (this could happen when using couple 3rd party plugins). Not finally decided to add the new key yet.

    For more tables, if you delete an image from WP library, we had to manually hook the deletion of related records in additional tables. But if use original postmeta table, we don’t need to do anything. This can reduce the additional hooks to WP. Hope I clarified ??

    Thread Starter Mikey

    (@mikeyhash)

    @hailite, yes, more clear now.

    Well, yes, as I said, saving stuff in postmeta is the easiest way to go ??

    But I would say that the delete_post hook can be used very easy, together with the simple function for the sql deletion from the new custom table.

    Perhaps you’d reconsider this.

    In the meantime, I will probably change the code on my website so that it doesn’t save the litespeed-optimize-size postmeta anymore.

    Plugin Support Hai Zheng?

    (@hailite)

    Sure you can always do that way. In future if we have any code changes to image optm class, the change log will tell. Just keep an eye on it ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Don’t save ‘litespeed-optimize-size’ in wp_postmeta’ is closed to new replies.