Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache fetched courses #51

Open
hieunguyent12 opened this issue Sep 20, 2023 · 3 comments · May be fixed by #69
Open

Cache fetched courses #51

hieunguyent12 opened this issue Sep 20, 2023 · 3 comments · May be fixed by #69

Comments

@hieunguyent12
Copy link
Contributor

hieunguyent12 commented Sep 20, 2023

In reference to Robert's comment #26 (comment).

Expected behavior:
When the user searches "MAC", all math courses are fetched like MAC2312, MAC2313, MAC1105, etc... What we want to do is cache all of these courses (I believe this is already the default behavior for React Query), so when the user queries a specific math course like MAC2312, we will fetch from the cache to get information for that specific course instead of refetching the API.

We can also fetch that course in the background and then update the cache with the latest information.

@elicampos
Copy link

Can I claim this issue?

@hieunguyent12
Copy link
Contributor Author

Yes, go ahead! I never really made any progress on this.

@elicampos
Copy link

Hello! I managed to get it working under a new branch but for some reason it's not giving me permission to push. I tried doing it on Linux and Windows. I implemented a system in which it caches the searches and the individuals courses. So if you search something that was previously searched, it will still pull from the cache(Basic React Query which you guys already had), however during this process it also caches each course found. So now for each course search, it sees if the result was a search or course and if neither it calls the API again. The only drawback to this is the fact that very large searches like "EEL" for example, take about 30% longer, as it's caching all the courses but again now every course with EEL pops up almost instantly.

@elicampos elicampos linked a pull request Feb 9, 2024 that will close this issue
@UF-OSC-TechLeads UF-OSC-TechLeads linked a pull request Feb 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants