NASA-IMPACT / veda-ui

Frontend for the Dashboard Evolution project
Other
20 stars 5 forks source link

Make embedded maps and scrollytelling maps load faster #1206

Open j08lue opened 2 days ago

j08lue commented 2 days ago

As a casual reader of an article, I expect key figures and widgets to load instantaneously, so I can quickly browse an article before diving in deeper.

Currently, maps embedded in stories and other articles can take a long time to load (20s or so).

  1. They seem to only start loading once they come into view
  2. When our Lambda-deployed tiling API is starting from cold state, startup time is 10-20s or so
  3. Also when the backend is "warm" it can take a while for the tiles to load.

Once cached (in the browser), scrolling past the map works nicely.

Is there a way to improve this? E.g. by triggering the embedded maps to start fetching the tiles as the story/page loads, not only when I load the map?

Same goes for scrollytelling.

Acceptance criteria

anayeaye commented 1 day ago

aside: @smohiudd @j08lue @stephenkilbourn I wonder if we ran the playwright tests on a schedule would help keep the services for the dashboard warm? I thought the status page would be enough to keep a minimal number of lambdas awake but we should also review the backend logs to see how often cold starts are happening.

stephenkilbourn commented 1 day ago

aside: @smohiudd @j08lue @stephenkilbourn I wonder if we ran the playwright tests on a schedule would help keep the services for the dashboard warm?

Playwright should hit every api endpoint that the app uses on a load. it may be simpler and less overhead to just keep the lambda warm with a schedule event bridge rule, though. https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html