garyditsch / three-sixity-five

Daily tracker for goals
0 stars 0 forks source link

Add cache behavior so that every filtered view does not require a new call to supabase (will require updated queries) #47

Open garyditsch opened 8 months ago

garyditsch commented 8 months ago

The calendar view pulls in all the behavior data which should be usable to run the filtered views, without having to make the filtered data call to the server.

  1. Navigate to calendar view: cache all behaviors array
  2. Always pass the full array to the component
  3. Build filter function in component to take in the searchParams to filter array to return new filtered array

-- This will work for calendar, list, and dashboard view --

This may work for daily view when just consuming the information but on both the index/main screen and the daily view edit will need to invalidate the cache so that the new behaviors logged can be returned and used in the views

garyditsch commented 7 months ago

Remix Videos on data loading / cache

Remix Docs on defer

garyditsch commented 7 months ago

Current look at the time taking to get network response. Everything is blocked for a full second. (On Feb 3 of the year, with only 1 user adding daily data)

Image

garyditsch commented 7 months ago

clientloader is more inline with what needs to get done then the defer:

https://remix.run/docs/en/main/route/client-loader#clientloader

Need to understand how the cache is managed when a behavior is logged (thus requiring a trip to server for updated data), or when a new goal is created.

https://www.youtube.com/watch?v=MrDhjB5ucHI&list=PLXoynULbYuEApkwAGZ7U7LmL-BDHloB0l&index=3

garyditsch commented 7 months ago

https://www.youtube.com/watch?v=fuwm0BBNkRY&list=PLXoynULbYuEApkwAGZ7U7LmL-BDHloB0l&index=5

https://github.com/localForage/localForage

Need to think through the plan on how to use the cache effectively.