3 ms·
This can be fixed easily ( i have read it fast, but i suppose this could be a fix) Add a boolean to a attachment in the db, queryDiff Add a string (for md5 ha
by NicoJuicy 13y ago
This can be fixed easily ( i have read it fast, but i suppose this could be a fix)
Add a boolean to a attachment in the db, queryDiff
Add a string (for md5 hash)
Calculate the hash on every file with a query parameter, if the file is requested the second time (with different query parameters), check if the file hash is the same.
If the file hash is the same, change the bool queryDiff
Next time you fetch the file, queryDiff is false, so you shouldn't fetch the url and only get the original one (which was already downloaded)
- jrochkind1 13y agoThere's no way to know if difference in query parameter is a different image or not, you can't simply re-use a prior URL which is equivalent but for query param in place of a new one. http://example.org/images?image_id=12121 http://example.org/images?image_id=7272
- NicoJuicy 13y agoIf http://example.org/images?image_id=12121 http://example.org/images?image_id=7272 contain the same images, chances are very high that other query parameters will be the same. If they are different, chances are very high that other query parameters are also different. Want to up your chances, then instead of only 2 requests, raise the bar to 10 different query parameter checks and add some additional db values (like CountFetch:int,sameUntillCurrentFetch:bool) As soon as sameUntillCurrentFetch = false, then you request all images in the future. If CountFetch = 5 and sameUntillCurrentFetch = true, then queryDiff = false. It's kinda weird my answer was downvoted, any better solutions to avoid the stated problem then?
- NicoJuicy 13y agoCalculate a md5 hash file to identify the image id http://stackoverflow.com/questions/4032209/is-md5-still-good-enough-to-uniquely-identify-files http://stackoverflow.com/questions/4032209/is-md5-still-good...