DerKarlos / OSMeta

OSM "Metaverse"
Other
15 stars 2 forks source link

Cache downloaded assets locally if possible #41

Closed oli-obk closed 7 months ago

oli-obk commented 7 months ago

fixes #4

https://github.com/dirs-dev/directories-rs#example explains where the cached files will be stored

on wasm we can't cache, as the browser wasm engines have no support for caching images and such (ironic, I know).

This reduces the load on the server significantly and also reduces re-startup times if an already visited region is visited again.

DerKarlos commented 7 months ago

Browsers are cashing anyway. The server settings are the limit. For the Settings, cookies are ok. I think, there is something like a Web-File-API for PWAs. To be considered "later"

DerKarlos commented 7 months ago

Where is the cache in the filesystem? Could we have an info!() ?

First start: Just one error: 2023-11-28T17:00:33.928344Z ERROR bevy_asset::server: encountered an io error while loading asset: error fetching textures/Fabi2-putz1.png: connection closed

2nd and more starts: 15 times this 2023-11-29T09:06:07.755709Z ERROR bevy_asset::server: Failed to load asset 'textures/cc0textures/Concrete034/Concrete034_ORM.jpg' with asset loader 'bevy_render::texture::image_loader::ImageLoader': Could not load texture file: Error reading image file textures/cc0textures/Concrete034/Concrete034_ORM.jpg: failed to load an image: failed to fill whole buffer, this is an error in bevy_render.