AfterClass-io / afterclass.io-v2

[alpha] v2 of https://afterclass.io!
https://afterclass-io.vercel.app
MIT License
4 stars 2 forks source link

[research] explore suitable caching strategies #102

Closed davidlhw closed 2 months ago

onebignick commented 2 months ago

What kind of caching strategies do you require?

was thinking something along the lines of https://nextjs.org/blog/security-nextjs-server-components-actions

davidlhw commented 2 months ago

hey @onebignick thanks for looking into this!

caching is no longer a necessary requirement at this moment, will be closing this issue

the initial problem was a lack of ways to assert user's access control & the specific type of resources that user is accessing without making a few unnecessary db queries (see #77)

this however, is addressed with #142 & #136

where we will leverage jwt managed by nextauth to store user identity params (things like user id, email, sch etc), and signed with a nextauth secret to ensure integrity

these fields will be used throughout server and client components to get specific information of the user which will be used to manage access control and specific resource rendering (ie which sch to filter for professors and courses)

until we see an increase in occurrences of events with significant latencies or db overloading, where there is rising need for a more sensible caching strategy, we can close this issue and reopen when needed

cc @Jaylin0312