[GH-ISSUE #255] Input image url with query string #117

Closed
opened 2026-02-25 22:34:23 +03:00 by kerem · 14 comments
Owner

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.

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.
kerem 2026-02-25 22:34:23 +03:00
Author
Owner

@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

<!-- gh-comment-id:611977493 --> @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
Author
Owner

@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.jpg

Then 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=3

This 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

<!-- gh-comment-id:612710298 --> @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.jpg` Then 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=3` This 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](http://afarkas.github.io/lazysizes/rias/). I hope this can be fixed somehow
Author
Owner

@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)

<!-- gh-comment-id:619889531 --> @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)
Author
Owner

@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?

<!-- gh-comment-id:1335694387 --> @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?
Author
Owner

@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.

<!-- gh-comment-id:1337058373 --> @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.
Author
Owner

@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 ?

<!-- gh-comment-id:1340721508 --> @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` ?
Author
Owner

@github-actions[bot] commented on GitHub (Aug 11, 2023):

This issue is stale because it has been open for 30 days with no activity.

<!-- gh-comment-id:1674131550 --> @github-actions[bot] commented on GitHub (Aug 11, 2023): This issue is stale because it has been open for 30 days with no activity.
Author
Owner

@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.

<!-- gh-comment-id:1692649884 --> @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.
Author
Owner

@nicolas-albert commented on GitHub (Nov 20, 2023):

I cannot get it work:
https://dummyimage.com/200x300?text=so%20good
vs
https://demo.flyimg.io/upload/w_200,q_90/https://dummyimage.com/200x300?text=so%20good
Query string is ignored.

<!-- gh-comment-id:1818359665 --> @nicolas-albert commented on GitHub (Nov 20, 2023): I cannot get it work: `https://dummyimage.com/200x300?text=so%20good` vs `https://demo.flyimg.io/upload/w_200,q_90/https://dummyimage.com/200x300?text=so%20good` Query string is ignored.
Author
Owner

@sadok-f commented on GitHub (Nov 20, 2023):

Hi @nicolas-albert
Thank you for reporting this issue, I'll check it out.

<!-- gh-comment-id:1818482913 --> @sadok-f commented on GitHub (Nov 20, 2023): Hi @nicolas-albert Thank you for reporting this issue, I'll check it out.
Author
Owner

@sadok-f commented on GitHub (Nov 20, 2023):

Hi @nicolas-albert , did you try to URL encode from ? onward? like this

https://demo.flyimg.io/upload/w_200,q_90/https://dummyimage.com/200x300%3Ftext%3Dso%20good
<!-- gh-comment-id:1818874915 --> @sadok-f commented on GitHub (Nov 20, 2023): Hi @nicolas-albert , did you try to URL encode from `?` onward? like this ``` https://demo.flyimg.io/upload/w_200,q_90/https://dummyimage.com/200x300%3Ftext%3Dso%20good ```
Author
Owner

@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

<!-- gh-comment-id:1821021454 --> @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](https://demo.flyimg.io/upload/w_200,q_90/https://dummyimage.com/201x300%3Ftext%3Dso%20good6)
Author
Owner

@sadok-f commented on GitHub (Nov 22, 2023):

yes can refresh the image when adding the param rf_1 to the URL options.
I'm gonna close the issue.
thank you again !

<!-- gh-comment-id:1822408482 --> @sadok-f commented on GitHub (Nov 22, 2023): yes can refresh the image when adding the param `rf_1` to the URL options. I'm gonna close the issue. thank you again !
Author
Owner

@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_1 solves 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.

<!-- gh-comment-id:2293598703 --> @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_1` solves 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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/flyimg#117
No description provided.