mirror of
https://github.com/flyimg/flyimg.git
synced 2026-04-25 09:45:50 +03:00
[GH-ISSUE #255] Input image url with query string #117
Labels
No labels
Docs
Docs
Docs
Security
UnitTest
bug
dependencies
duplicate
enhancement
enhancement
enhancement
hacktoberfest
help wanted
invalid
pull-request
question
stale
version 1
version 2
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/flyimg#117
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Checkumeito on GitHub (Apr 1, 2020).
Original GitHub issue: https://github.com/flyimg/flyimg/issues/255
Originally assigned to: @sadok-f on GitHub.
Hello,
Currently, flyimg ignore the query string of the input image URL. This cause problem for some image files being hosted at some provider that relies on the query string to serve newer / updated cached version.
Clearing the flyimg local cache or force refresh does not work as the image is cached at source, and served with query string.
@sadok-f commented on GitHub (Apr 10, 2020):
Hi @Checkumeito,
Thank you for opening this issue, could you please provide more information about the issue, with examples will be really helpful.
Thank you again !
Sadok
@Checkumeito commented on GitHub (Apr 13, 2020):
Hello,
I upload image A to the provider, the provider give me the URL:
http://theme.hstatic.net/1000366282/1000553011/14/mobile_6_image.jpgThen I run through my flyimg to resize it down to my liking.
I change my mind and replace image A with image B, They give me another URL: with a query string
http://theme.hstatic.net/1000366282/1000553011/14/mobile_6_image.jpg?v=3This display image B correctly.
However, the original URL still display image A because the provider hasn't invalidated their edge cache yet.
When I run the URL with the query string into my flying, the image A still appears. I believe flyimg did not process the URL with the query string being used as cache busting/versioning. I also tried deleting everything in tmp and uploads, and add rf_1 but to no available.
Does my explanation make sense? The links I give you are a real example but it may not be accurate as the provider may invalidate the cache at any time.
I really love flyimg especially when I pair it with lazysizes RIAS plugin. I hope this can be fixed somehow
@sadok-f commented on GitHub (Apr 27, 2020):
Hi @Checkumeito,
Thank you very much for providing those details, I'll work on it asap.
(Sorry for the late reply, been busy all this period)
@visioncode commented on GitHub (Dec 2, 2022):
@sadok-f same issue here. I need to get my source images via a PHP script which includes the path, e.g. example.com/files?path=logos/microsoft.jpg .. unfortunately it results in a convert error. I figured out that the query string must be the problem. Any quickfix available?
@sadok-f commented on GitHub (Dec 5, 2022):
Hi @visioncode , thanks for bringing up again this issue.
I'll try to work on fixing it and get back to you.
@sadok-f commented on GitHub (Dec 7, 2022):
Hi @visioncode,
did you try to encode the image path?
something like
http://localhost:8080/upload/w_200/http://example.com%2Ffiles%3Fpath%3Dlogos%2Fmicrosoft.jpg?@github-actions[bot] commented on GitHub (Aug 11, 2023):
This issue is stale because it has been open for 30 days with no activity.
@github-actions[bot] commented on GitHub (Aug 25, 2023):
This issue was closed because it has been inactive for 14 days since being marked as stale.
@nicolas-albert commented on GitHub (Nov 20, 2023):
I cannot get it work:
https://dummyimage.com/200x300?text=so%20goodvs
https://demo.flyimg.io/upload/w_200,q_90/https://dummyimage.com/200x300?text=so%20goodQuery string is ignored.
@sadok-f commented on GitHub (Nov 20, 2023):
Hi @nicolas-albert
Thank you for reporting this issue, I'll check it out.
@sadok-f commented on GitHub (Nov 20, 2023):
Hi @nicolas-albert , did you try to URL encode from
?onward? like this@nicolas-albert commented on GitHub (Nov 21, 2023):
Ok, it's work. The query part is ignored for the cache entry, if I change the size, it's ok: https://demo.flyimg.io/upload/w_200,q_90/https://dummyimage.com/201x300%3Ftext%3Dso%20good6
@sadok-f commented on GitHub (Nov 22, 2023):
yes can refresh the image when adding the param
rf_1to the URL options.I'm gonna close the issue.
thank you again !
@ebner commented on GitHub (Aug 16, 2024):
@sadok-f I ran into the very exact problem as reported by @nicolas-albert, the query part seems to be ignored when caching. Using
rf_1solves another situation, I don't want to force a re-request of the image, I just want the requests to honor the correct query parameter.Example:
URL 1: https://demo.flyimg.io/upload/w_120,h_90,c_1/https://images.citybreakcdn.com/image.aspx%3fImageId=7965154
URL 2: https://demo.flyimg.io/upload/w_120,h_90,c_1/https://images.citybreakcdn.com/image.aspx%3fImageId=7965155
Pay attention to the last character of the URLs, it's two different pictures, but the picture from URL 1 is also returned for URL 2.