Forums

Share app between session?

My app takes about 40 seconds to init (on Colab) due to processing it does (no Db or Disk usage, plain in memory init) Is there a way to do it once (once a day or something like that) so when a new session starts it uses the ready app with redoing the whole process?

If you do that initialisation at import time then it will be performed once per worker and will be available for later use. You can store the result of the initialisation in a global variable and then you can access it from your views later.