requests-cache / aiohttp-client-cache

An async persistent cache for aiohttp requests
MIT License
116 stars 20 forks source link

Question about url pattern matching. #236

Closed holymode closed 3 months ago

holymode commented 4 months ago

If I have

urls_expire_after = {
    'https://thumbnails.roblox.com/v1/users/avatar': timedelta(days=3),
}

will it also cache the result for 3d for this? https://thumbnails.roblox.com/v1/users/avatar?userIds={user_id}&size=720x720&format=Png&isCircular=false Or do I need to match it differently?

The example in the docs are not very clear for this. At least for me.

JWCook commented 4 months ago

Yes, that URL will match.

Patterns will match request base URLs. So it will basically treat https://thumbnails.roblox.com/v1/users/avatar the same as https://thumbnails.roblox.com/v1/users/avatar** (either the exact URL or anything starting with that).