Skip to content

24 ways to impress your friends

Vote down?

Matt Wilcox

@ John B

AI already instructs proxies to not cache and browsers to cache – so I don’t think there’s any advantage (and likely a disadvantage) to punting the image request to a CDN. The disadvantage would be you’re then relying on an additional provider to send an image and having to wait for access to an external resource. The only possible advantage I can see is not using your own server’s space – otherwise it’s always going to be slower than using a local file?

I agree, using PHP to pipe an image will be slower than just loading the image, but AI’s already going to use PHP to select the right image, so it doesn’t make much difference? As you say – if there’s a way to get the .htaccess to do it without firing up PHP that’d be beneficial, but I just don’t think it’s possible because the PHP has to do so much that the htaccess couldn’t (does the file exist at that resolution? If not does the source file exist? If so should it be downscaled? Do the downscale & save the file. If it does exist at that location anyway is it newer than the original file (i.e., not stale)) – there’s no way you can do that stuff without PHP (or Ruby, or however it’s implemented).

As for the last paragraph – absolutely with you on that too! A little bit torn, but my pragmatic side is saying that it’s not really an issue.

Thanks for the feedback and giving this a good think over – just the sort of thing I was hoping for :D