Skip to content

Conversation

Mantisus
Copy link
Collaborator

Description

  • change custom LRUCache to cachetools.LRUCache. In my opinion, functools.lru_cache's logic isn't well-suited for this use case. Therefore, if we want to modify our caching approach, using cachetools appears to be a better option.

Issues

@Mantisus Mantisus self-assigned this Feb 16, 2025
@Mantisus Mantisus requested a review from vdusek February 16, 2025 02:47
Copy link
Collaborator

@vdusek vdusek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Do we have please dome mechanism how to test/ensure that the cache is being used?

@Mantisus Mantisus requested a review from vdusek February 17, 2025 16:41
@Mantisus
Copy link
Collaborator Author

Do we have please dome mechanism how to test/ensure that the cache is being used?

Now, we have 🙂.

@vdusek vdusek changed the title chore(deps)!: change custom LRUCache to cachetools.LRUCache chore(deps): change custom LRUCache to cachetools.LRUCache Feb 17, 2025
Copy link
Collaborator

@vdusek vdusek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@vdusek vdusek merged commit 30324bd into apify:master Feb 18, 2025
23 checks passed
Mantisus added a commit to Mantisus/crawlee-python that referenced this pull request Feb 19, 2025
…#988)

### Description

- change custom `LRUCache` to `cachetools.LRUCache`. In my opinion,
`functools.lru_cache's` logic isn't well-suited for this use case.
Therefore, if we want to modify our caching approach, using `cachetools`
appears to be a better option.

### Issues

- Closes: apify#86
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.

Better approach of making a cache
2 participants