(SOLVED) How to avoid HTTP cache being flushed to disk?

The game I’m working on has a lot of http.request calling to get files from a local server. Whenever there is an update on the server (from the files requested), if flushes. I’m not too worried for computer, but I looked, and saw is stored over 100 KB of just the same files with same files with some changes. I can just delete this on computer with code, but I’m not sure if mobile devices will allow that nor do I know how to get the app do delete cache.

Main question: Does http data flush to mobile devices? If so, is there a way I can delete it without having users manually do it or just stop it from flushing at all?

Thanks!

The http cache will automatically remove old cached data. The default lifetime is 5 days:

But we respect the max-age Cache-Control header:

On Android we use the location provided by getFilesDir() which is for application internal files. These files may be cleaned up by the system over the lifetime of the application but it is not guaranteed (which is why we prune the cache ourselves). The files will be deleted on app uninstall.

2 Likes

If you really wish, there’s an option to disable http cache altogether, by setting it in the game.project:

[resource]
http_cache = 0

[network]
http_cache_enabled = 0

[liveupdate]
enabled = 0
4 Likes

You also have the option to ignore the 304 directly in the http.request().

3 Likes

Alright, thanks @britzl & @Mathias_Westerdahl for your answers.

Also sorry for not fairing, I occasionally forget to do that.