I've read the page. So it compiles my templates to python byte code. Does that mean I can load templates faster? But it seems I still have to query database to get data.
The website I'm building is my learn-by-do project. It's just a forum running on my linux server or google app engine which my friends and I can play around on it. I know querying database when a request comes in is easy and good enough. I've already implemented serving pages that querying database a lot and render pages with templates every time. I just want to know how could I implement a basic caching mechanism, not a big caching system which has caching strategies and complex algorithms or stuff like that. Just a simple and straight-forward one. On Wednesday, June 26, 2013 5:00:54 AM UTC+9, Tomas Schertel wrote: > > On Tuesday, 25 June 2013 16:16:31 UTC-3, Jox wrote: >> >> On Wednesday, June 26, 2013 3:15:50 AM UTC+9, Tomas Schertel wrote >>> >>> >>> Sorry for asking, but why do you need to have a cache for pages? >>> Could you save them as blob on database? >>> How would you verify if something changed? >>> >> >> Because I don't wanna query database and re-render page for some >> read-heavy page over and over again, >> I think cache is a good solution to solve this. >> >> Redis, the software I used to cache data is kind of database too.... and >> of course I can save cached data >> into postgres, but as cache may be updated frequently, save cached page >> into database is not a good idea, I think. >> Redis save data in RAM, postgres save data in hard drive, hit RAM is much >> cheaper than hit disk. >> >> When things changed, say, a user post and change the data in the >> database, I update the cache which are expired. >> >> I'd like to know if web.py has features of templetor I don't know yet to >> help me with this problem. >> > > Can I understand this as a personal preference? > Maybe you can take a look at > https://pypi.python.org/pypi/jinja2-precompiler. > -- You received this message because you are subscribed to the Google Groups "web.py" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/webpy. For more options, visit https://groups.google.com/groups/opt_out.
