Jump to content

File caching?


predaware
 Share

Recommended Posts

Hi Josh, et al,

My project pulls data as a file (using DownloadFile) from my remote server and saves it to the PATH_DOCUMENTS folder. I need to be able re-pull this file down again and see any changes to it reflected in my app. What appears to be happening is that the data is being cached, and the original values retained. Even if I delete the downloaded file using DeleteFile, it gets re-created verbatim. If I re-start the app, then it seems to pull down a fresh copy.

I'm only 24 hours into the library, so I'm still getting up to speed, but I thought I read about a caching system somewhere. Is there a way to disable that?

Of course, there's still a chance that I'm just doing something wrong, but I don't think so.

Thanks for your help,

EDIT: I found a work-around (I append the current microseconds as a dummy CGI variable to the URL, which forces the cache to re-download) but would still like to know if there's a proper way to disable the cache or force the download.

John

Link to comment
Share on other sites

The location of the download cache is here:

C:\Users\(USERNAME)\AppData\local\Ultra Engine\WebCache

Can you delete that folder manually and then see what happens?

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Actually...calling ReadFile() with a URL will use the cache so that files aren't constantly re-downloaded. DownloadFile does not use the cache and downloads the file every time. It's basically just doing this:

bool DownloadFile(const WString& src, const WString& dest)
{
	return URLDownloadToFileW(NULL, src.c_str(), dest.c_str(), 0, NULL) == S_OK;
}

So there is something else going on with the Windows command or your server?

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...