You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The cold start of the Static Web App API function app sk_render is really causing us a problem and managed function apps cannot be configured to be warm.
Our current workaround is to ping the site regularly to keep it warm, however we would prefer a less hacky approach.
Is it possible to somehow run sk_render in a dedicated function app and then configure the adapter to use the dedicated function app which we can then configure to be warm?
Or do you or others have any other suggestions how to manage this issue?
Thank you
The text was updated successfully, but these errors were encountered:
Same issue here, looking for a good fix. Speaking to Azure support they recommend not using (managed) azure functions in the SWA as there is no way to avoid cold starts.
They mentioned that if the function app is idle for 5 ish minutes that the worker will be deallocated due to the way consumption plan's handle worker allocation. They recommended to either include a timertrigger that runs every minute to keep the app warmed up. (I don't know how to add additional Azure Functions to the deployed package). Or to move the Function App into an App Service Plan to have always-ready instances.
This seems to be an issue with other frameworks on SWA, not just Svelte - see Azure/static-web-apps#1545
I don't have the bandwidth right now to figure out how to support non-managed function apps with this adapter, but contributions are welcome! You should be able to clone the adapter into your project's repo and import from it directly instead of from node_modules. Then you can test any modifications you make with your deployed app.
There isn't a lot of magic with this adapter, it just bundles an azure function for server-side rendering and then writes it to the build/server folder (or a custom directory). Then, the SWA config is set to re-write all GET calls without a prerendered asset to that route. You should be able to edit the built function directly, e.g. if different configuration needs to be set to make it non-managed.
Hello,
The cold start of the Static Web App API function app sk_render is really causing us a problem and managed function apps cannot be configured to be warm.
Our current workaround is to ping the site regularly to keep it warm, however we would prefer a less hacky approach.
Is it possible to somehow run sk_render in a dedicated function app and then configure the adapter to use the dedicated function app which we can then configure to be warm?
Or do you or others have any other suggestions how to manage this issue?
Thank you
The text was updated successfully, but these errors were encountered: