Caching problem with purchase attachments

Continuing the discussion from Uploaded file name change defaults to stored copy:

Just had this problem again. Deleted an attached file and uploaded a new version with the same name. When I viewed the file it showed the old version even though the on screen date stamp was for the new latest upload time. Took a few minutes to figure and was about to start a new post which brought up my previous post above. Cleared the attached file cache and problem fixed.

It would be handy if I, and possibly others, didn’t have to spend time re-figuring out the solution. Brain is full and refuses to store this stuff! I know it’s a caching problem but any thoughts on how to stop it other than remembering to change name or clear cache. There’s that memory problem again.

Nick

What sort of file was it you uploaded?

I’ll try to replicate this but I suspect it’s down to the cache settings on your browser. Speaking of which, what browser are you using?

It was a pdf and I’m using chrome

Had a quick look in settings but can’t see anything other than clearing cache on browser close. The problem is that you check the current attachment to see which version it is and hen delete and upload the new one. If I need to close the browser I could just as easily clear the cache.

I can’t replicate this I’m afraid.

  1. I took two PDF files with different content but identical names.
  2. Uploaded the first one to a purchase.
  3. Previewed the PDF in Chrome.
  4. Deleted the attachment.
  5. Uploaded a new attachment with the same name but different content
  6. Previewed the new PDF in Chrome

When previewing the second PDF it loaded that different PDF as expected.

When you view the new PDF, if you hold CTRL and hit refresh this will force the cache to be cleared.

EDIT:

One simple thing we can do to always force your browser to avoid differing to it’s cache is to append a random number to the query string. That’s quite easy to do and may be a quick fix to the problem.

I think your fix might do it. Typically when I update a file I have used Bullzip to append pages to the original pdf file so I am uploading a newer version of the original. Perhaps that is the reason you cannot replicate?

It could be the reason! The fix I mentioned has already been done, it’s just waiting to go live (1-2 days). You’ll know when it’s gone live if you observe the URL, it will have a ?v=############### appended to the end.

That’s brilliant, thanks

This change is now active!

Cheers Glenn, much appreciated.