imageresizer if-modified-since support

58 Views Asked by At

I'm trying to figure out why does imageresizer returns "HTTP/1.1 200 OK" and not "HTTP/1.1 304 Not Modified" status code when performing If-Modified-Since, Contrary to request without imageresizer which returns "HTTP/1.1 304 Not Modified" as excepted.

I'm using IIS with imageresizer resizing module only and the command syntax as below:

curl -I --header 'If-Modified-Since: DATE-FORMAT-HERE' http://x.x.x/x.jpg

Thanks, Yaron

1

There are 1 best solutions below

2
On

If you have the DiskCache plugin installed, then modified dates will be provided, but the actual serving of the cached file is delegated to the StaticFileModule or whichever HttpModule is next in line to handle the request. ImageResizer itself doesn't handle the serving. This decision was made to optimize request throughput as StaticFileModule uses IIS's native code for serving files and is highly optimized. It's very surprising that it doesn't honor if-modified-since requests.

In Imageflow.NET Server, we handle the serving, so we can add support for these kinds of requests. We already support ETags and If-None-Match, which is more precise and reliable than If-Modified-Since. Are you sure you can't use the newer Imageflow.NET Server instead?