From discussion Content version available in js?
Continuing the discussion from Content versions:
Enonic version: 6.6.2-SNAPSHOT
OS: Mac and Linux
Just wondering if there are any way to get the content version id in js.
It’s shown in Content Studio, so maybe there is a way.
I plan to use it to cache the rendered page, such that if you publish a new version, you remove the previous and cache the new rendered page. Sort of like etag.
This is fetched through a separate call in Content Studio, to get all/active versions of a content. This is not exposed in the content-lib at the moment. Ill add it to Features-request, since it sounds like a valid usage.
Remember, a rendered page may contain a lot of items that are not related to the page itself - so simply using the version may fail in many such caching scenarios. If there is a minimum of traffic on your site you shold simply cache things, and invalidate based on change events I guess.
Yes, I’ve gone back to stateless for now.
I’d still like the idea of accessing content-version from js though.
This is added to our backlog.