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

Poor man's cache #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Poor man's cache #2

wants to merge 1 commit into from

Conversation

Shereef
Copy link
Contributor

@Shereef Shereef commented Dec 13, 2023

This will try and use an in memory cache for as long as the function lives helps when everyone is on and trying to call the badge tracker cache resets after one hour

This will try and use an in memory cache for as long as the function lives
helps when everyone is on and trying to call the badge tracker
cache resets after one hour
@MrCsabaToth
Copy link

That's very useful. I was also wondering: so every visit triggers a web scrape?
Thoughts about caching:

  1. Maybe we can use functools.lru_cache
  2. Can also consider https://pypi.org/project/memoization/

@Shereef
Copy link
Contributor Author

Shereef commented Jan 27, 2024

That's very useful. I was also wondering: so every visit triggers a web scrape?
Yes

Thoughts about caching:

  1. Maybe we can use functools.lru_cache

  2. Can also consider https://pypi.org/project/memoization/

Both can be used. Same result. The more lightweight the cheaper it is though

Cloud functions memory and cloud u cost more

@MrCsabaToth
Copy link

Oh, so adding a new module is more overhead due to the install? functoool is built-in but I'll look if lru-cache or anything can be used for memoize

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 this pull request may close these issues.

2 participants