Example of connecting a Cloud Run service to Redis via a VPC connector
Redis is used to keep track of the last load of the site and stores the last viewer's browser name and version. When a new person loads the page they see their own browser name and version, plus the info from the last person to load the site.
You'll need:
- GCP Memorystore running redis
- A Serverless VPC Connector to connect your Cloud Run service to Redis
- REDISTHOST environment variable setup for your Cloud Run service to reference your Memorystore Redis
Environment Variable | Example value |
---|---|
REDISHOST | 10.10.10.10 |