karpetrosyan / hishel

An elegant HTTP Cache implementation for HTTPX and HTTP Core.
https://hishel.com
BSD 3-Clause "New" or "Revised" License
158 stars 19 forks source link

Make file cache scanning more efficient #253

Closed Simon-Will closed 2 months ago

Simon-Will commented 2 months ago

By using os.scandir, we can save the syscall for is_file.

Closes #252.

karpetrosyan commented 2 months ago

Thanks for this PR, that's really very useful :pray: . I think it would also be good to add a changelog entry here, and it will be ready for merge. Feel free to press the merge button; I've sent the collaborator invite so you can do it.

Simon-Will commented 2 months ago

Great, thanks! I added the changelog entry and will merge!