8000 Add note for high volume push requests (#2366) · hanv89/python-docs-samples@f755338 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit f755338

Browse files
Add note for high volume push requests (GoogleCloudPlatform#2366)
* Add note for best practices for high volume push requests
1 parent c96596a commit f755338

File tree

1 file changed

+6
-0
lines changed
  • appengine/standard_python37/pubsub

1 file changed

+6
-0
lines changed

appengine/standard_python37/pubsub/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ def receive_messages_handler():
7676

7777
# Verify and decode the JWT. `verify_oauth2_token` verifies
7878
# the JWT signature, the `aud` claim, and the `exp` claim.
79+
# Note: For high volume push requests, it would save some network
80+
# overhead if you verify the tokens offline by downloading Google's
81+
# Public Cert and decode them using the `google.auth.jwt` module;
82+
# caching already seen tokens works best when a large volume of
83+
# messages have prompted a single push server to handle them, in which
84+
# case they would all share the same token for a limited time window.
7985
claim = id_token.verify_oauth2_token(token, requests.Request(),
8086
audience='example.com')
8187
# Must also verify the `iss` claim.

0 commit comments

Comments
 (0)
0