You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After I read some big json file from somewhere, I want to make that internally available by my app to work on it, Or when user queries it to return from cache, I can use @cache.memoize() on get function for user to use and for my app to use, But there is a one time hit of getting the json from my DB.
As I am populating that data myself, is it possible to populate that in cache explicitly so my app just uses that ?
The text was updated successfully, but these errors were encountered:
@sh4nks I've the same question - it's not immediately clear how to access the cache directly from any place in the Flask application.
For example, the following doesn't work (not that it should; I'm just trying to figure out how to use it!):
from flask import current_app
def set_default_cache_value_in_helper_file():
with current_app.app_context():
current_app.cache.set("some_key", "some_value")
After I read some big json file from somewhere, I want to make that internally available by my app to work on it, Or when user queries it to return from cache, I can use
@cache.memoize()
on get function for user to use and for my app to use, But there is a one time hit of getting the json from my DB.As I am populating that data myself, is it possible to populate that in cache explicitly so my app just uses that ?
The text was updated successfully, but these errors were encountered: