I'm working on a dynamic thumbnail generation feature for a site, and I am using mod_rewrite features to do a quick caching of the images that are already generated.
I do this with the following Rewrite conditions:
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-s
RewriteRule ^/thumber/images/([0-9]+)_([0-9]+)_(.+)$ /thumber/thumbnail.cfm?src=$3&w=$1&h=$2 [PT,L,QSA]
The first line makes sure that the rewrite rule only forwards to my script page if the requested image doesn't already exist.
This works fine in Apache 2, but when I move the same rules to an IIS server with ISAPI Rewrite 3 Lite then it always acts as if the file doesn't exist, even after the first redirect when the thumbnail has already been generated.
In short, for some reason the !-s flag appears as if it's not working at all. I have also tried with !-f and there is no change.
I'm thinking that maybe this version of ISAPI Rewrite is using some sort of cached information to determine if the file exists or not.
Other than that I can't understand why it works on Apache but not on ISAPI.
Please help!
Thanks