[Avg. reading time: 2 minutes]

Redis Cache Demo

Fork and Clone

git clone https://github.com/gchandra10/python_flask_redis_mysql_demo.git

Rename config.yaml.template file to config.yaml

mysql:
  host: localhost
  user: yourusername
  password: yourpassword
  port: mysqlport

redis:
  host: redis_host_name
  db: 0
  user: default
  password: redis_password
  port: redis_port

Remember, by default, redis starts with db:0 and user: default.

Unless you specifically create a new one.

uv run python app.py

or

poetry run python app.py

or

python app.py

Navigate to

http://127.0.0.1:8000

Now call http://127.0.0.1:8000/film/1

The request will be made from MySQL

Refreshing it again, it will be from Redis.

Check the Time taken to load the data.

#cache #demo #mysqlVer 5.5.3

Last change: 2025-10-15