flask-cache icon indicating copy to clipboard operation
flask-cache copied to clipboard

Flask-Cache memoize make a lot of cache key in redis for same url and query string call

Open tuphamphuong opened this issue 10 years ago • 2 comments

My project use Flask-Cache for some "high cost" report api based on Flask-Restful. Integration with Flask-Cache so simple but as the tittle "Flask-Cache memoize make a lot of cache key in redis for same url and query string call" Normally, Flask-Cache make 4-6 cache key before using the cache. Please help me resolve this problem. Thanks.

tuphamphuong avatar May 03 '15 03:05 tuphamphuong

Here is more detail: Note that Flask-Cache use diffrence cache keys to cache same content of same url and query string call. screen shot 2015-05-03 at 10 56 07 am

https://www.evernote.com/shard/s326/sh/2b32e6de-15d7-4cb2-a736-e123e2271b29/e7430bb9dddfa38e78e5b09c3fd157bb

tuphamphuong avatar May 03 '15 03:05 tuphamphuong

It looks like you are caching objects and they do not have a repr function defined that would allow flask-cache to convert the object to a string that would be common amongst different instances of flask.

See the warning in the following section: https://pythonhosted.org/Flask-Cache/#memoization

thadeusb avatar Jan 26 '16 23:01 thadeusb