{"action":"created","issue":{"url":"https://api.github.com/repos/pulibrary/loris/issues/142","labels_url":"https://api.github.com/repos/pulibrary/loris/issues/142/labels{/name}","comments_url":"https://api.github.com/repos/pulibrary/loris/issues/142/comments","events_url":"https://api.github.com/repos/pulibrary/loris/issues/142/events","html_url":"https://github.com/pulibrary/loris/issues/142","id":54062299,"number":142,"title":"SimpleHTTPResolver is getting 404 for every non-cached IIIF request","user":{"login":"regisrob","id":402117,"avatar_url":"https://avatars.githubusercontent.com/u/402117?v=3","gravatar_id":"","url":"https://api.github.com/users/regisrob","html_url":"https://github.com/regisrob","followers_url":"https://api.github.com/users/regisrob/followers","following_url":"https://api.github.com/users/regisrob/following{/other_user}","gists_url":"https://api.github.com/users/regisrob/gists{/gist_id}","starred_url":"https://api.github.com/users/regisrob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/regisrob/subscriptions","organizations_url":"https://api.github.com/users/regisrob/orgs","repos_url":"https://api.github.com/users/regisrob/repos","events_url":"https://api.github.com/users/regisrob/events{/privacy}","received_events_url":"https://api.github.com/users/regisrob/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-12T14:56:04Z","updated_at":"2015-01-13T14:51:18Z","closed_at":null,"body":"The Loris log file shows that the SimpleHTTPResolver by @scande3 is sending requests to the remote server for every single IIIF request that has not been previously cached. \r\nConsidering the docstring in resolver.py, I assumed that the resolver was making only one http request to retrieve the source image, copying it into the local cache, and using that local copy for every subsequent IIIF request sharing the same identifier. \r\n\r\nBut if you look at the log file below (in this example image identifer is \"B452346101_C102/ecran/B452346101_C102_0005.jpg\"), a new request returning 404 is sent every time you change a IIIF parameter (response will always be 404 since the remote server is not IIIF-enabled, by definition)\r\n\r\n<pre>\r\n2015-01-12 14:11:17,453 (loris.resolver) [INFO]: Copied http://www.example.fr/B452346101_C102/ecran/B452346101_C102_0005.jpg to /path/to/local/cache/loris_cache.jpg\r\n\r\n2015-01-12 14:14:50,942 (requests.packages.urllib3.connectionpool) [INFO]: Starting new HTTP connection (1): www.example.fr\r\n2015-01-12 14:14:51,035 (requests.packages.urllib3.connectionpool) [DEBUG]: \"GET /B452346101_C102/ecran/B452346101_C102_0005.jpg/full/,150/0/default.jpg HTTP/1.1\" 404 None\r\n\r\n2015-01-12 14:18:27,049 (requests.packages.urllib3.connectionpool) [INFO]: Starting new HTTP connection (1): www.example.fr\r\n2015-01-12 14:18:27,078 (requests.packages.urllib3.connectionpool) [DEBUG]: \"GET /B452346101_C102/ecran/B452346101_C102_0005.jpg/full/full/0/bitonal.jpg HTTP/1.1\" 404 None\r\n\r\n2015-01-12 14:40:49,003 (requests.packages.urllib3.connectionpool) [INFO]: Starting new HTTP connection (1): www.example.fr\r\n2015-01-12 14:40:49,037 (requests.packages.urllib3.connectionpool) [DEBUG]: \"GET /B452346101_C102/ecran/B452346101_C102_0005.jpg/50,80,250,250/full/0/default.png HTTP/1.1\" 404 None\r\n</pre>\r\n\r\n@jpstroop @scande3 : is it a normal behaviour? Isn't there a risk of server overload? (above all if you intend to use a viewer like OpenSeadragon which sends dozens of requests for each image)"},"comment":{"url":"https://api.github.com/repos/pulibrary/loris/issues/comments/69755048","html_url":"https://github.com/pulibrary/loris/issues/142#issuecomment-69755048","issue_url":"https://api.github.com/repos/pulibrary/loris/issues/142","id":69755048,"user":{"login":"regisrob","id":402117,"avatar_url":"https://avatars.githubusercontent.com/u/402117?v=3","gravatar_id":"","url":"https://api.github.com/users/regisrob","html_url":"https://github.com/regisrob","followers_url":"https://api.github.com/users/regisrob/followers","following_url":"https://api.github.com/users/regisrob/following{/other_user}","gists_url":"https://api.github.com/users/regisrob/gists{/gist_id}","starred_url":"https://api.github.com/users/regisrob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/regisrob/subscriptions","organizations_url":"https://api.github.com/users/regisrob/orgs","repos_url":"https://api.github.com/users/regisrob/repos","events_url":"https://api.github.com/users/regisrob/events{/privacy}","received_events_url":"https://api.github.com/users/regisrob/received_events","type":"User","site_admin":false},"created_at":"2015-01-13T14:51:18Z","updated_at":"2015-01-13T14:51:18Z","body":"@scande3 Thanks a lot for your comprehensive answer, now I think I understood the logic of having this extra request. \r\nSo It should not be an issue for us too in terms of server overload (and we only have to deal with static jpeg)"}}