Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional caching? #14

Open
imaia opened this issue Jan 12, 2017 · 4 comments
Open

Optional caching? #14

imaia opened this issue Jan 12, 2017 · 4 comments

Comments

@imaia
Copy link

imaia commented Jan 12, 2017

An optional integration with flask-cache could do some wonders here.

@stewartpark
Copy link
Owner

Can you explain a little bit more about this? 😁

@imaia
Copy link
Author

imaia commented Jan 19, 2017

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.

@imaia
Copy link
Author

imaia commented Feb 7, 2017

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.

@pbrackin
Copy link

pbrackin commented Mar 20, 2017

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants