Skip to content

Commit

Permalink
Implementing redis caching
Browse files Browse the repository at this point in the history
- Added caching to the ruby /api_request
- Moved 0.5 from the /get_iterator to the ruby request to preserve trace timing and not impact web vitals
  - Cache hits will preserve the 2s on get_iterator
  - Cache misses will steal 0.5s

- Also setup redis in gcp memory store
- Created VPC connector in GCP
- Created redis-relay to communicate locally with cache

Only runs locally atm. Will require env vars added to flask / redis in GCP to enable communcations in our VPC
  • Loading branch information
lukemun committed Nov 21, 2024
1 parent 0cf2957 commit 3bd3e5d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,19 @@ cd react
../env.sh local npm start
```

## Run Caching Locally

To run caching locally, you will need to setup port forwarding from you local machine to GCP redis instance.
1. gcloud auth login
2. gcloud compute ssh redis-relay --zone=us-central1-a -- -N -L 6379:10.251.35.179:6379

You should now be authenticated and have the relay running. Use redis-cli ping to check.

3. If you have REDISHOST in your .env, comment it out. We want flask to point to localhost.
4. Run flask server



## Deploy to Prod

This script deploys the flagship apps React + Flask. For deploying a single app to App Engine, check each platform's README for specific instructions. Make sure you don't have any local changes to `env-config/production.env`.
Expand Down

0 comments on commit 3bd3e5d

Please sign in to comment.