lucy24 - 9:07 pm on Jun 27, 2011 (gmt 0)
I mean that if you've already got an image cached, and you're testing your hotlink routine, your browser may simply give you the cached copy instead of asking the server for a fresh one. An even worse scenario is when your ISP (not your site host, your personal ISP) does its own remote caching. Sometimes they'll reload on request; sometimes they won't bother.
So when you're testing things, make sure to test using a brand-new filename that can't possibly be cached anywhere.
Oh, and I only just noticed that your original code starts with .* You can toss that part; all you're matching is the extension.
.jpe?g .gif .png are the only formats guaranteed to be recognized by all browsers. (Except lynx, duh, and let's not talk about MSIE 5.) So there's no reason to take up more computer time looking for stuff it will never find anyway. Remember, this is your own site so the extensions are under your control. You're not checking for everything that someone, somewhere might have put up because they don't know what they're doing. (Like the local rental agency that had all their graphics in AOL-proprietary format. Really.)