0

My website is hosted in Windows server 2008 R2. We have a software for which updates are downloaded using winsock from our websites. It works properly for all customers(more than 20000 for last few years). In some Computer of my customers I found that the it downloads old file from a website instead of new file. For example instead of downloading update.txt, it downloads file update.txt.old with name update.txt .Actually update.txt.old is the old file we keep in server.

I have checked browsing the file using chrome and proper file is downloaded. I tried using netsh winsock reset command , resetting Internet explorer, clearing cache, temporary files etc and problem didn't solve.

So is there anyone who know about this strange error , how can I troubleshoot?

2
  • What do you mean by "using WinSock"? Is this code embedded in your software? Can you post an example related to the specific part that downloads this file?
    – gtirloni
    Sep 9, 2014 at 18:20
  • 1
    Check if you're behind a proxy and ask the client to add rules prohibiting it from caching your specific file. lagado.com/proxy-test
    – gtirloni
    Sep 9, 2014 at 18:22

2 Answers 2

0

Usualy such problems caused by cashing on CLIENT side (e.g. caching proxy for accessing internet). You can TRY to deal with it from server side using Cache-Control headers, but it's not 100% solution. Also you may additionaly specify content type (e.g. Content-Type: application/octet-stream) for your downloads.

7
  • So now how can i check whether this is caused by caching proxy? Any commands to solve this error in a PC so that i can test and check. Sep 8, 2014 at 9:16
  • You can install somethng like Internet Explorer developer toolbar (microsoft.com/en-us/download/details.aspx?id=18359) and examine updates requesting/downloading with it to check all page headers and web page/file data...
    – Sergey
    Sep 8, 2014 at 9:37
  • But when files downloaded from IE it works properly. Error only when file gets downloaded using winsock Sep 8, 2014 at 9:39
  • is the URL hardcoded or user can edit it? Sep 9, 2014 at 11:55
  • 1
    mc0e had a great suggestion, try downloading example.com/update.txt?bogus=[random_stuff] to see if this solves the issue temporarily. If it does, than caching is the problem, if not... then probably not. It's an easy way to narrow down the options.
    – Ty H.
    Sep 13, 2014 at 18:23
0

This is likely to be due to caching, whether server side or client side (or sometimes in-between as in a corporate network cache).

A common source of confusion is where file dates have gone backwards. Eg if you revert some files to a backup version. Your server sees that the cache is more recent than the files modification time, so tells the client or intermediary cache that it's OK to keep using their cached version, despite the content on the server having changed (ie reverted) since that version was downloaded.

Do you get the right content if you add some bogus arguments to the URL? eg http://example.com/update.txt?bogus=[random_stuff]. EDIT: If this doesn't get you the right version of the file, then caching is not your problem.

Does clearing the browser cache help?

Does a hard refresh help. Eg ctrl-shift-R in firefox. Sometimes this will clear out a server-side or intermediary cache for the urls of the current page and embedded resources.

EDIT: You say that the results you see are dependent on the HTTP Client involved. Find out what's different about the actual query that's involved. There are various ways to do that server side, but if the request is unencrypted, you might be best to just use something like wireshark and/or ngrep to pick the request off the wire.

1
  • clearing browser cache didnt work. Also error does not come if file is downloaded in IE or chrome Sep 10, 2014 at 5:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .