-
Questionhi im currently running into a problem where the logo on my website and some other images will not load. i sometimes have to refresh it 5 times for it to finally load. In my fly.io logs it says
minimal code reproduction: from nicegui import ui
ui.image('app/utils/assets/images/banks-logo.png')
ui.run() is there a more optimised way to serve images |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Your fly deployment seems to run multiple instances. The uuids for your assets are auto-generated via id. And each instance will have it's own id. Have you seen our remark in https://github.com/zauberzeug/nicegui/wiki/fly.io-Deployment#next-steps? To implement sticky sessions you may want to read #3212 and https://github.com/zauberzeug/fly_fastapi_socketio. |
Beta Was this translation helpful? Give feedback.
-
just realised #3212 was my own issue i made. i implemented the middleware which stopped the refreshing problem which should find the right instance. however it doesnt work for images? how do i set it to a single instance per region |
Beta Was this translation helpful? Give feedback.
for each region you have you can call
fly scale count app=1 --region <your-region-id> -y
.