Strange caching issue


Last night I encountered a very bizarre issue that took me over an hour to find the cause of. I noticed that for some reason the images on my newly-uploaded site weren't caching, and every time you visited the page in your browser it'd re-download them.

Naturally I assumed it was either the server or the CMS, so I spent a good while eliminating both scenarios and eventually established that neither were responsible. I then turned to Photoshop, but again a process of elimination ruled it out.

As a last resort I looked into the way I was uploading the images, and surprisingly if I used either FileZilla or my web server's software-based file uploader the issue didn't occur. I then re-uploaded them using SmartFTP to test again, and the issue returned.

Utterly bewildered, I looked at the file response headers to see if there was any difference between the SmartFTP-uploaded file and those uploaded by other means. While those uploaded by other means had fairly predictable response headers (just the usual), those uploaded by SmartFTP seemed to have 'Connection: Keep-Alive' and some other line that I can't recall off hand. The other line had something like 'max-time: 98' in it.

I'm going to go ahead and assume those extra response headers are responsible for the strange behaviour. The question is: how do I stop it? I disabled SmartFTP's own 'keep-alive' options (being the only thing seeming remotely related) and it didn't help.

If you want me to provide any more details to diagnose this I'll be happy to do so after work.

Sorry but this doesn't make any sense.

Yeah, it dumbfounded me too.

If you don't know the possible cause then I don't know what to say. All I know is that when literally having SmartFTP and any other FTP program open at the same time and uploading the same file to the same server, the file would have extra response headers if uploaded through SmartFTP. I don't have the faintest idea how it could have happened, but that's what I observed.

If this is impossible then there must have been another factor at play, but as I said above I literally exhausted every other area and could only directly cause a difference when swapping FTP software. I guess this a mystery that'll continue.

Try to upload your file(s) in ASCII mode.