rendertron
rendertron copied to clipboard
any guidelines for programatically generating the files used as part of the filesystem cache?
Love Rendertron, love the new release. Been using the filesystem local cache store and it works well. Problem is it takes on average 6 seconds to generate the page the first time. So I've been pre-caching by making sure to warm up the cache so that it's fresh and snappy when the actual search engines arrive.
However in my case, 99% of my pages are basically the same page with different data so it seems I could easily generate the files myself by creating a template with placeholders and then just replacing them.. cutting down my generation time from 6 seconds per page to 100ms
I was wondering if there are any guidelines or potential traps in approaching it this way? I still want to use Rendertron but I want to help it warm up the cache where I can
Thanks!
@vesper8 that's an interesting idea. Considering the cache files are JSON (?), If you manage to generate them outside rendertron, technically it should work. The generated cache file names do use hashes so that will be something that you will need to make sure matches with what rendertron expects. Else the cache lookup will result in miss.
Though I will like to ask you, if you are able to generate the final HTML (using templates) outside rendertron, how does rendertron fit in your requirement? (Considering rendertron's core value add is to generate HTML for JS heavy sites).
@gravi2 Thanks for the response and the interest. I already figured out how to mimic the hash, it's a simple md5 hash of the full url.
To answer your question, in my use-case I would not pre-generate all pages and Rendertron would still serve to generate those pages that I don't generate and also to protect me in case I make a mistake with a wrong hash or forget to generate certain pages.
For example I wouldn't generate unique pages such as the home page, the about page, the contact page, etc, but I would pre-generate item pages such as mydomain.com/item/1 to mydomain.com/item/1000
Those are my main content pages that matter the most and those are the ones that take forever to re-generate if I make a structural change to any