[firebase_app_check] Can you document when assessment requests are made? #18010
-
|
I'm using Flutter web and reCAPTCHA enterprise I would like to reduce the cost of reCAPTCHA enterprise and hence I would like to reduce the number of assessment requests. In Firebase, I've increased "Token time to live" to 7 days so I would assume that this would somehow halve the number of assessments (assuming that my users return at least twice a week). Can you explain when an assessment request happens and what I can do to reduce the number of requests? Thanks a lot! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Good question, the docs are thin on this. Here's the actual behavior: When assessment requests happen:
Why a 7-day TTL isn't halving your assessments:
What actually reduces assessment count:
Rough arithmetic: At 7-day TTL with 2 sessions per week: each session is either cold or half-expired → ~2 assessments per week. Same as a 1-day TTL in that usage pattern. TTL only helps when user sessions last longer than half the TTL and the cache survives between sessions. Most web users don't match either condition. |
Beta Was this translation helpful? Give feedback.
Good question, the docs are thin on this. Here's the actual behavior:
When assessment requests happen:
initializeAppCheckfinds no valid cached token, the SDK requests one from reCAPTCHA Enterprise. One assessment per fresh session.isTokenAutoRefreshEnabled: true(the default), the SDK refreshes the token at ~50 % of TTL, not at expiry. A 7-day TTL refreshes at ~3.5 days → one additional assessment.getToken(true)— force-refresh bypasses the cache.Why a 7-day…