Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images loosing quality without adding quality query parameter #53

Closed
gijo-varghese opened this issue Dec 17, 2019 · 18 comments
Closed

Images loosing quality without adding quality query parameter #53

gijo-varghese opened this issue Dec 17, 2019 · 18 comments

Comments

@gijo-varghese
Copy link

gijo-varghese commented Dec 17, 2019

I haven't added ?quality to the URL, but still, images seem to be compressed and lose quality.

Original: https://wpspeedmatters.com/wp-content/uploads/2019/08/flying-birds-1160x680.jpg
Statically: https://cdn.statically.io/img/wpspeedmatters.com/wp-content/uploads/2019/08/flying-birds-1160x680.jpg

@gijo-varghese
Copy link
Author

The issue is still there

@thegulshankumar
Copy link

I can confirm as well about quality loss.

Original: https://gulshankumar.org/wp-content/uploads/2019/05/gulshan-kumar.jpg
Statically: https://cdn.statically.io/img/gulshankumar.org/wp-content/uploads/2019/05/gulshan-kumar.jpg

@Deliciae
Copy link

I have the same issue:

Original: https://explorista.nl/wp-content/uploads/2019/08/MilouHuis3.jpg
Statically: https://cdn.statically.io/img/explorista.nl/wp-content/uploads/2019/08/MilouHuis3.jpg

@adrien-robert
Copy link

I can confirm the quality lose even with quality=100

@fransallen
Copy link
Member

Hi everyone!

Many thanks for the query and sorry for such a late response!

Compression is enabled by default, so maybe that's why the image quality decreases even with quality=100. I will try to increase the default max quality for JPG images without increasing the file size, the current is 85%.

In the near future, I will make improvements to the image server to make it more reliable. But this is such a big job, it would be awesome if you'd consider donating through BountySource so that I can free up time to implement a much improved Statically Images.

@gijo-varghese
Copy link
Author

@fransallen i would suggest to deliver uncompressed images when quality query is not specified. This is what everyone expects and assume.

@gijo-varghese
Copy link
Author

@fransallen a lot WordPress users might have already compressed their images before integrating Flying Images/Statically

@fransallen
Copy link
Member

fransallen commented Jan 19, 2020

Hi Gijo,

Understood. Increasing the max quality of JPG will solve this problem. The image will still be processed but does not reduce quality. I will try to do the work this morning.

Best,
Frans

@gijo-varghese
Copy link
Author

@fransallen ok, pls let us know once it is done.

Also, the entire cache will be purged after this?

@gijo-varghese gijo-varghese changed the title Images loosing quality without adding ?quality Images loosing quality without adding quality query parameter Jan 20, 2020
@fransallen
Copy link
Member

@gijo-varghese
Copy link
Author

@fransallen yes, this looks much better!

@gijo-varghese
Copy link
Author

@fransallen any updates?

@fransallen
Copy link
Member

fransallen commented Jan 30, 2020

Hey, good news everyone! Frans is got this fixed.

@gijo-varghese would you update the purge request link on Flying Images plugin with https://statically.io/purge? This will give the internal team a better workflow to help purge the cache.

@gijo-varghese
Copy link
Author

@fransallen yes. I'll update the link.

So everyone has to purge the cache to get the new changes?

Also, I tried adding a version=x to Statically URL, expecting a new image will be delivered for change in "x". But look like Statically doesn't cache based on query strings. Can you pls confirm this?

If so we can provide users with two options:

  1. Purge entire cache (version will be incremented)
  2. Purge cache by files (contact Statically)

What do you think?

@fransallen
Copy link
Member

Caching each query string will only damage the HIT ratio, I hardly suggest renaming the file instead.

  1. How does purge entire cache work? Unfortunately, wildcards are not supported with a single URL purge at this time.
  2. Yep, use purge page please. With notes, this won't be fast.

@gijo-varghese
Copy link
Author

gijo-varghese commented Jan 30, 2020

@fransallen people might have thousands of images in their WP. Since the above quality issue is fixed, what should they do to purge the entire cache?

In situations like these, it's better to increment a version and serve new files. Yes, it will reduce cache hit ratio, we can warn users about it. But I think there should be a way to purge the entire cache.

@fransallen
Copy link
Member

fransallen commented Jan 30, 2020

I'm referring to the Statically cache hit ratio, warn users might not be necessary. Because we don't want to hurt our cache hit ratio, so we normalize requests and remove query strings that have no effect on our apps, that's why adding a miscellaneous query string won't change the image that has already been cached.

Currently, there is no way to purge the entire cache from a URL path, it must be an exact URL(s). I certainly understand what we need is a way to clear cache on /img/example.com/*, but I am unable to provide it at this time.

There are a few tricks to getting a new version of file (even though thousands of images are on WP):

  • Play with registered query strings such as quality, w, and h. The new quality query will be more than enough to serve low-quality images without much-reducing image quality, so it's no problem to change it now.
  • Use ?ssl=1 to force Statically download images from the HTTPS protocol.
  • Rename the uploads folder.

There are still many ways to get a new version of image without having to purge cache. But let me know if there are other questions from your side Gijo.

@gijo-varghese
Copy link
Author

ok. I'm closing the issue since the original issue is fixed.

Congrats and thanks, Frans! 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants