Redis Cache Demo

git clone https://github.com/gchandra10/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.

python3 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.

Last updated