Questions tagged [flask-caching]

52 questions
1
vote
0 answers

Flask-Caching craches on accessing endpoint

I started from scratch the project but get this error * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) Exception possibly due to cache backend. Traceback (most recent call last): File…
Alexey Nikonov
  • 4,958
  • 5
  • 39
  • 66
1
vote
0 answers

Flask-Caching in Azure App Service , which uses gunicorn server

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…
qaiser
  • 2,770
  • 2
  • 17
  • 29
1
vote
1 answer

How to automatically clear cache of Flask-Caching after TIMEOUT interval?

The Cache class provides a way for the cache to timeout when caching using cache.cache(timeout=TIMEOUT). But, it doesn't delete the cache automatically after the timeout interval. The only way to clear the cache is by calling cache.clear() which…
lahsuk
  • 1,134
  • 9
  • 20
1
vote
1 answer

How to cache simple Flask Restful API

I am working on my first Flask Restful API and I'm trying to cache it for a week so that it only sends out a single request to update on Sundays. I am planning to upload it to Heroku on a Sunday so that the timeout (604800) I've set is synced to…
squidg
  • 451
  • 6
  • 17
1
vote
1 answer

what does "not threadsafe" mean? Using SimpleCache (python dictionary Cache) in Flask app

I'm thinking of using SimpleCache to store Python dataframes in a DASH app. Apparently it just uses a Python dictionary. Is it possible to get a partially-written dataframe out of the SimpleCache? That's my big concern. what other issues could I run…
1
vote
0 answers

AttributeError: 'inspect module' object has no attribute 'signature' for python 2.7

In my application till now I have been using flask-caching 1.0 but now I have to upgrade it to version 1.8 to use the newly intriduced changes but with python 2.7 its giving attribute error AttributeError: 'module' object has no attribute…
Kaushal Pahwani
  • 464
  • 3
  • 11
1
vote
0 answers

Delete redis cache in Flask-Caching during request

Using redis in combination with Flask_caching. When data changes the app uses cache.clear() to clear redis keys, which works. However, when a user request a page for a record that is not in the database redis fills up with keys. I would like to keep…
DaJudge
  • 53
  • 1
  • 7
1
vote
1 answer

How to use flask-caching in my structure of project

My code structure. I tried but kept getting error cannot import name 'caching'. I guess my method isn't correct as caching will not have app initiation when I import caching in external file. xyz -app.py -run.py -urls -v2.py -resource …
Jay Prakash
  • 149
  • 10
1
vote
0 answers

Debugging Web Authentication for Apache Airflow

I am trying to enable web authentication for my gcp vm running an airflow server. I used the official docs to update the config file: [webserver] authenticate = True auth_backend = airflow.contrib.auth.backends.password_auth as well as create an…
d_-
  • 1,391
  • 2
  • 19
  • 37
1
vote
1 answer

flask caching - handle exception when redis service is down

I have a simple code using flask: @app.route('/foo/') @app.cache.memoize() def foo_response(arg): return 'Hello ' + arg This is working great while my redis server (cache server) is up. If the redis server goes down, an exception is raised…
0
votes
0 answers

Caching view function in flask when it is also called directly with flask-caching

I have a flask application where I have some frontend views and some api views which are also called to render the frontend directly by the app, something like the example that follows: @app.route("/stop/") def stop(stop_id): …
Iago
  • 1
  • 3
0
votes
0 answers

Flask cache with redis

I need to cache the modules using Redis and each module cache data need to be in separate hash table. Let me say, I have 2 modules: employee company Now the API's related to employee module need to be cached in the hash table employee. For…
Vyshnavi
  • 149
  • 2
  • 10
0
votes
0 answers

Flask Caching - Static file performance

I am currently using Flask for API development. With regards to caching, can I ask what is the best practice to decide on what to actually cache? To give some context, I tried caching an image generated by flask's send_file(,…
Hola
  • 11
  • 5
0
votes
0 answers

When using Redis backed cache in a Flask application, is the cached data thread safe?

I have the following scenario: I have multiple instances of a Flask application behind a load balancer serving an API for a front end web client. This flask application interfaces with a database to query and insert data. Under certain conditions,…
joelghill
  • 3
  • 5
0
votes
1 answer

Flask Caching an answer with dual response format depending upon 'accept-encoding' header

I have a Flask application for which I have applied successfully caching. However now I need to also send the response in compress mode if and only if the header 'accept-encoding = gzip' is present. Otherwise just sent plain JSON. I am using this…
Fabio
  • 555
  • 3
  • 9
  • 24