Skip to content

Poor man's cache#2

Open
Shereef wants to merge 1 commit into
romanejaquez:mainfrom
Shereef:patch-1
Open

Poor man's cache#2
Shereef wants to merge 1 commit into
romanejaquez:mainfrom
Shereef:patch-1

Conversation

@Shereef
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown

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