Open imaia opened 7 years ago
Can you explain a little bit more about this? 😁
Yeap; if the js file is served by the view, it would be nice to have that response cached. With SPA's, caching this particular view is not a big problem, but with non-spa websites, it could quite help avoid unnecessary requests to the view.
Something like:
FLASK_GSGLUE_USE_CACHE = True
Then jsglue could lookup if flask-cache is installed and use it if available.
Another option would be to cache the view response with the http server cache. I'm unsure about which solution would fit best. Maybe having both options would be nice.
Another approach would be to create an option to disable adding gluejs route. This way, the user could add a route to gluejs with caching enabled.
@imaia is right on the money. I have a site that is an RPA "reduced page application", but still has some page loads... I chose to abandon JSGlue because of this. Also the nginx req limiter had to be raised just a tad to accomodate this JS or else it would get queued. If there was a way to cache the spun JS, I woulda liked to keep it. Its still a good idea.. just needs some tuning methinks. Good luck!
An optional integration with flask-cache could do some wonders here.