vircadia-native-core
vircadia-native-core copied to clipboard
Experiment with Qt HTTP caching options
potentially closes https://github.com/vircadia/vircadia/issues/92 and https://github.com/vircadia/vircadia/issues/990 fixes https://github.com/vircadia/vircadia/issues/1062
should theoretically
- remove the need for cachebusting
- improve loading times
also adds a reload button next to model URL in create
Test plan/open questions:
- confirm that cachebusting scripts/models is no longer necessary (links won't update automatically, you'll still need to refresh the script or modelURL).
- verify that the reload button next to model URL in create works
- compare loading times (initial/loading from cache) between this PR and master. is this PR faster?
- does it respect HTTP expiry times? can someone smarter than me make a test for this
The following links are available: build (ubuntu-18.04, full)
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-2c4fd58_b8b9cdc5.sh
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-2c4fd58.tar_b8b9cdc5.gz
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-2c4fd58.tar_b8b9cdc5.Z
build (macOS-latest, full)
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-2c4fd58_b8b9cdc5.dmg
build (ubuntu-18.04, android)
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-Quest-Alpha-PR1012-2c4fd58_b8b9cdc5.apk
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-2c4fd58_b8b9cdc5.apk
build (windows-latest, full)
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-2c4fd58_b8b9cdc5.exe
So originally when we discussed cachebusting the idea was turned down because of concerns about web servers being set up properly to support that feature. While I was always for cachebusting, has the discussion happened again and the result changed this time?
This is implementing I think exactly what we were talking about. Webservers do have cache information in them, but currently we do not respect that. This gets us a bit closer to respecting that where possible.
yeah I think this is a pretty standard feature? this PR basically amounts to “use more default Qt values, and use them more correctly”
The following links are available: build (macOS-latest, full)
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-3879882_b9b801f8.dmg
build (ubuntu-18.04, full)
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-3879882.tar_b9b801f8.gz
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-3879882_b9b801f8.sh
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-3879882.tar_b9b801f8.Z
build (windows-latest, full)
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-3879882_b9b801f8.exe
build (ubuntu-18.04, android)
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-3879882_b9b801f8.apk
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-Quest-Alpha-PR1012-3879882_b9b801f8.apk
Seems to work. A refresh button would definitely be useful. I uploaded a model,then modified is slightly in blender, reuploaded to my S3, then removed the link and repasted and the model. The updated model appeared without cache-busting.
One way to do this would be to have the refresh button empty the field and then paste back in the URL quickly (hacky method). The other method might be to have an actual scripting API call that allows you to just trigger a reload for a resource. Given that the system handles that pretty well...
It's possible that multiple parts of the system are looking at the URL for a change, but I'm hoping that it's simply the case that the resource being refeteched would update all layers. As for falling out of sync with others, it can send a message for others' Create app's to do the same call on that model?
yeah for now the best way to do this would be to set the URL to "" and then set it back to the actual URL, just to make sure everything picks up on the change. we might just need to copy how it works for the script field? someone who understands create more than me might need to take that over
Theoretically you could lose the URL if the reload button removes the URL and adds it back. On Linux this happens often enough.
Note: In the Create app, the client script and server entity script fields both have a "reload" button.
ok added a reload button, ready for testing
The following links are available: build (ubuntu-18.04, full)
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-fee508d-.tar_2fed5124.Z
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-fee508d-.tar_2fed5124.gz
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-fee508d-_2fed5124.sh
build (macOS-latest, full)
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-fee508d-_2fed5124.dmg
build (windows-latest, full)
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-fee508d-_2fed5124.exe
build (ubuntu-18.04, android)
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-fee508d_2fed5124.apk
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-Quest-Alpha-PR1012-fee508d_2fed5124.apk
Refresh seems to work, but its worth noting the the new object will retain the dimensions or the original (reset dimensions will correct this). This is not a bug, and is desirable in many cases, but worth considering in the future.
Compared loading The Hub content on this PR versus 2021.1.0. There doesn't seem to be any noticeable difference for me,
Compared loading The Hub content on this PR versus 2021.1.0. There doesn't seem to be any noticeable difference for me,
Is there any way to make downloads work even if links redirect? I'm not sure how the system works or how things like that work in general.
However, between caching improvements and redirecting users to downloads that are on edge servers I think we can get fast loading times.
Compared loading The Hub content on this PR versus 2021.1.0. There doesn't seem to be any noticeable difference for me,
My understanding is that, load times should be same or worse. Old behaviour is to just never update the cache. So whatever you downloaded would not change even if the source file changed. My understanding is that this PR contacts the server to find out if the cache is outdated.
The following links are available: build (macOS-latest, full)
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-d6b3159-_2fed5124.dmg
build (ubuntu-18.04, full)
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-d6b3159-_2fed5124.sh
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-d6b3159-.tar_2fed5124.Z
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-d6b3159-.tar_2fed5124.gz
build (windows-latest, full)
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-d6b3159-_2fed5124.exe
build (ubuntu-18.04, android)
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-d6b3159_2fed5124.apk
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-Quest-Alpha-PR1012-d6b3159_2fed5124.apk
Test with webserver caching options set to no cache...
So, I've found that the refresh button doesn't update for file:/// or https:// cases, did not try others but basically I see the model blink as if it's reloading except the new model doesn't show up.
I test this by...
- renaming my model on the server after loading it once
- hitting refresh in the Create app, but the model stays the same it was even though it should be a whole new model, just with the exact same filename and path
However, the test for cachebusting in general worked successfully...
- rename the model on the server after loading it once
- go to the tutorial world under "Help" -> "Tutorial" then return back to the world
- notice that the model is now the new model
I do not believe my caching options on the webserver affected either case much.
hmmm how is that different than what @Aitolda tried originally and reported success for?
So I finally got to digging into this again and now I'm simply confused. I tried the newest version of this PR and couldn't get it working, so I started backtracking all the way to the first release on Feb 9, which was on the old protocol and it worked suddenly. Got excited, tried again, and it didn't work. Frustrated, I tried again and this time it worked. Seems to be inconsistent.
Here's what I've been doing.
I have two models that are both simply named "cube.glb" One of these is rotated off axis. I load up one, confirm it's working. Go to the model box in the properties dialogue and remove the link or add some gibberish. SOMETIMES the box becomes a green outline as expected. sometimes there is no effect on screen and the model remains.
Next I replace the original file on my S3 with the alternate cube.glb. In the properties dialogue I re-paste the link (identical). If the model had turned into the green outline previously, I now see the new model as expected, but if it remained visible, nothing happens.
Again so far I've only got this working on the original Feb 9th version but it's worth trying the others again. Will keep investigating.
Going by Aitolda's comments it seems this needs more testing still
The following links are available: build (macOS-latest, client)
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-Interface-PR1012-a2125fb-_8e472fc4.dmg
build (macOS-latest, full)
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-a2125fb-_8e472fc4.dmg
build (ubuntu-18.04, full)
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-a2125fb-.tar_8e472fc4.gz
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-a2125fb-.tar_8e472fc4.Z
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-a2125fb-_8e472fc4.sh
build (windows-latest, full)
- https://athena-public.s3.eu-west-3.amazonaws.com/builds/PR/vircadia_vircadia/PR1012/Vircadia-PR1012-a2125fb-_8e472fc4.exe
Hello! Is this still an issue?