Question 9
Consider the following flask application.
app.py:
from flask import Flaskfrom flask_caching import Cacheimport time
config = { "DEBUG": True, "CACHE_TYPE": "RedisCache", "CACHE_REDIS_URL": "redis://localhost:6379/1", "CACHE_DEFAULT_TIMEOUT": 300}app = Flask(__name__)app.config.from_mapping(config)cache = Cache(app)
@app.get('/name/<name>')@cache.cached(timeout=100)def get_name(name): time.sleep(50) return name
if __name__ == '__main__': app.run()Suppose the application is running on “http://localhost:5000”. If the client makes two requests (one after another) to URL “http://localhost:5000/name/mohan” first at 11:30PM and second at 12:30PM. What will be the approximate absolute difference between their latencies?
50 Seconds
60 Seconds
0 Seconds
None of these