Tuesday 26 March 2013

jcr:content versus _jcr_content in URL paths of AEM?



AEM seems to use "_jcr_content" when accessing any resource that is part of a page.
This also means the dispatcher seems to expect that in the URLs, since it will create the following file structure:
/page.html
/page/_jcr_content/par/other stuff and images etc.

When a page is activated/flushed/deleted, the dispatcher deletes the HTML file and the complete "_jcr_content" folder that goes with it - and all is fine.
Now when "jcr:content" is used instead, e.g. in a Javascript that loads a json, like:
/page/jcr:content/test.json
this will also work fine, because CQ/Apache Sling is able to figure out the right resource.
But the dispatcher will cache it in a subfolder like
/page/jcr:content/test.json

 The main issue here is with Windows OS that could not create folders with “:” in their name. As a result of this dispatcher cache could not be created.
On publish side CQ converts “Jcr:content” to “_jcr_content”. So always make sure that JS calls to resources in CQ publish instance had “jcr:content” converted to “_jcr_content”.

No comments:

Post a Comment