Question 22
Consider the following flask application.
app.py
from flask import Flaskfrom flask_caching import Cachefrom time import sleep
config = { "CACHE_TYPE": "RedisCache", "CACHE_REDIS_HOST": "localhost", "CACHE_REDIS_PORT": 6379, "CACHE_REDIS_DB": 1}
app = Flask(__name__)app.config.from_mapping(config)cache = Cache(app)
@app.get('/')@cache.cached(timeout=40)def home(): sleep(30) return "hello world"
if __name__ == "__main__": app.run(debug=True)Suppose the application is running on “http://localhost:5000”. If user1 visits the URL “http://localhost:5000” and after 3 minutes user2 visits the same URL. What will be the approx difference between the response time for user1 and user2?
0 seconds
30 seconds
120 seconds
None of these