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
While looking at the code on github, I noticed there is automatic caching of results, with a default expiration of 5 seconds.
However, since if a web server is calling your code to populate values on a page view, won't this reload your python code on every page view? If so, I'm guessing none of the caching will stick around since I don't think you are writing it to a file or anything.
This is a request for a way to somehow have the cache persist across multiple page views on the web server. If it is possible to do this with a certain webserver config rather than modifying the code, please let me know.
I'd just like to say thanks so much for your contribution of the python-tstat code. My son and I are thinking about taking on a web controlled thermostat, and since he is learning python, we think your library might be perfect for us.
The text was updated successfully, but these errors were encountered:
The caching is intended to prevent the thermostat from receiving requests in quick succession for functions like getTime, getSetPoints, etc., which would otherwise generate multiple requests for the same address. In testing I noticed that the thermostat will stop responding if you send it requests too quickly (or more than one request at a time). The caching is supposed to help with that.
I think most people probably use this library to grab the data and store it in a database, and then pull the data from the database for the frontend. I suppose you could turn the cache expiration way up and use this library more directly as a frontend.
I don't really have time to test it at the moment, but I added a branch called "persistent_cache" that will read the cache from a file at startup and write it to the file every time it is updated. Please feel free to fork this and make changes to it.
While looking at the code on github, I noticed there is automatic caching of results, with a default expiration of 5 seconds.
However, since if a web server is calling your code to populate values on a page view, won't this reload your python code on every page view? If so, I'm guessing none of the caching will stick around since I don't think you are writing it to a file or anything.
This is a request for a way to somehow have the cache persist across multiple page views on the web server. If it is possible to do this with a certain webserver config rather than modifying the code, please let me know.
I'd just like to say thanks so much for your contribution of the python-tstat code. My son and I are thinking about taking on a web controlled thermostat, and since he is learning python, we think your library might be perfect for us.
The text was updated successfully, but these errors were encountered: