1

below code is work absolutely fine , when i am using development server in my local machine , but when i tried to deploy this to azure app service it is not working . In Azure App service gunicorn is the server that we are using .

does Flask-Caching support gunicorn server ?

or is there way around to do this

from flask_caching import Cache
from flask import Flask

config = {
 "DEBUG": True,          # some Flask specific configs
 "CACHE_TYPE": "filesystem", # Flask-Caching related configs
 "CACHE_DEFAULT_TIMEOUT": 3600
  }

app = Flask(__name__)
app.config.from_mapping(config)
cache = Cache(app)


@app.route('/getdata/<a>/<b>')
@cache.memoize(3600)
def getdata_(a,b):
    result = "some function which output result"
    return result
qaiser
  • 2,770
  • 2
  • 17
  • 29
  • Can you expand on: `it is not working`. What behaviour are you seeing? – v25 Aug 25 '20 at 17:47
  • @v25 , in my local system after caching the time is reduced from 19 second to approx 450 ms , but from appservice there is no change in the time – qaiser Aug 26 '20 at 04:31
  • i have changed the Cache_TYPE from simple to filesystem , as simple is used only for development server – qaiser Aug 26 '20 at 04:32
  • Did changing to 'filesystem' resolve this issue? – v25 Aug 27 '20 at 11:24

0 Answers0