zoltan-fedor / falcon-caching Goto Github PK
View Code? Open in Web Editor NEWCaching extension for the Falcon web framework. https://falcon-caching.readthedocs.io
License: MIT License
Caching extension for the Falcon web framework. https://falcon-caching.readthedocs.io
License: MIT License
Running into an error when installing the latest version of falcon-caching
[appname/app app 1/1] RUN pip3 install -r requirements.txt --src /usr/local/src:
#23 0.254 + pip3 install -r requirements.txt --src /usr/local/src
#23 1.235 Collecting pynamodb (from -r requirements.txt (line 1))
#23 1.596 Downloading https://files.pythonhosted.org/packages/74/2b/524ffd7a9d2f816e0be468f38a6dd5fc737bd16cb1e907f1a34fd387906e/pynamodb-5.2.1-py3-none-any.whl (57kB)
#23 1.654 Collecting falcon==2.0.0 (from -r requirements.txt (line 2))
#23 1.954 Downloading https://files.pythonhosted.org/packages/19/30/edff5a1fea7a8e9876c8391e170263e1bb207875b6a65cd619818487b27b/falcon-2.0.0.tar.gz (397kB)
#23 2.466 Collecting falcon-caching (from -r requirements.txt (line 4))
#23 2.660 Downloading https://files.pythonhosted.org/packages/4d/cf/16666df8f3899194241bf1dfc04e6bb4e602ec3586b8dbea4e2cc55190ee/falcon-caching-1.0.1.tar.gz (78kB)
#23 2.879 Complete output from command python setup.py egg_info:
#23 2.879 Traceback (most recent call last):
#23 2.879 File "<string>", line 1, in <module>
#23 2.879 File "/usr/lib/python3.6/tokenize.py", line 452, in open
#23 2.879 buffer = _builtin_open(filename, 'rb')
#23 2.879 FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-build-qbj_2599/falcon-caching/setup.py'
#23 2.879
#23 2.879 ----------------------------------------
#23 2.896 Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-qbj_2599/falcon-caching/
------
failed to solve: executor failed running [/bin/bash -xc pip3 install -r requirements.txt --src /usr/local/src]: exit code: 1
Our falcon version has been pinned to 2.0.0, wondering if that has anything to do with this failure.
We have the same issue when applying Falcon hooks to a whole class, and our logic there is not bullet-proof either.
However, it is slightly more advanced than just checking startswith('on_')
, we use this IIRC:
https://github.com/falconry/falcon/blob/8779753eaeb9be7313ae68eb43d82f0ba3a6cbb8/falcon/hooks.py#L25
Hi,
I'm using pylibmc
and the docs specify:
# Break convention and set options on the _client object directly. For pylibmc behaviors: cache.cache._client.behaviors["tcp_nodelay"] = True
But when i try to use it i got this error:
AttributeError: 'Client' object has no attribute 'behaviors'
I'm using the last version available (0.3.1)
Not seeing SSL key configuration in redis using falcon caching
It is quite unusual for GET
or HEAD
requests to have a non-empty body at all, but even for cached responders that do handle the request body, the stream would have been emptied and left at EOF if completely consumed.
Therefore, either would these responders interfere with the cache key logic, or the cache middleware would consume the stream leaving nothing for requests.
Ref:
falcon-caching/falcon_caching/middleware.py
Line 119 in 536faee
Hello @zoltan-fedor,
and thanks for porting/developing this caching component ๐ ! (And thanks for also adding it to our Wiki, that's the way I discovered it).
Btw, do not hesitate to join our Gitter channels, such as falconry/dev ๐
Re this caching component, I just had a couple of notes which I thought filing as issues ๐
The first one comes here:
In Falcon 2.0, the default context type for req.context
and resp.context
was changed to a bare class, i.e. it is now preferred to write req.context.cached = True
etc.
Unless I misinterpreted the middleware code, it seems that response headers are not cached:
This is probably fine as an MVP if documented as that could probably be patched in other middleware processing responses, but it seems that not even the Content-Type
is cached, meaning all cached responses would use the default Content-Type
(application/json
in vanilla Falcon).
You could also take a look at my Falcon ASGI tutorial (which I hacked together very quickly a couple days ago, so don't expect super high quality, particularly the tutorial text is dull and repetitive), I was demoing a simple cache there: https://github.com/vytas7/falcon-asgi-example/blob/070d23306b2a15c7ad395f8ff72f01cf6ef4e5c4/asgilook/asgilook/cache.py#L27 (the concept could be easily extended to include all headers).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.