Well, maybe this sounds complicated to the experienced alfresco users, but this is what I have done by now. I am writing it in case someone can point out a better solution.Starting with this on my localhost:tcpdump -A 'port:8080'I discovered that a lot of cmis queries was made, all begin with this:
select f.cmis:objectId, w.ws:hostName, w.ws:hostPort, t.cm:title, t.cm:description, w.ws:webAppContext, w.ws:siteConfig from cmis:folder as f join ws:website as w on w.cmis:objectId = f.cmis:objectId join cm:titled as t on t.cmis:objectId = f.cmis:objectId
This results in retrieving all ws:website present on alfresco repository, even the one that has nothing to do with the current web site.Each web site was then queried for retrieving getWebSiteInfo which results in a new cmis call.I track it down to the WebSiteServiceImpl, where the mentioned query is used.First of all I implemented my own custom WebSiteServiceImpl to supply a more restrictive query, which limit the result to the precise web site. It is fairly easy to supply the query as a spring property, rather than having it hard coded.Then I see that for each web site a logo request was also made, which results again in a new cmis call.
Asset logo = assetFactory.getSectionAsset(siteInfo.rootSectionId, logoFilename, true);
webSite.setLogo(logo);
I just commented it out.As a final step, I increased these two values:
/** Cache timeout values (seconds) */
private int webSiteCacheRefreshAfter = 60;
private int webSiteSectionCacheRefreshAfter = 60;
That's it for the moment. The initial request now takes from 1 to 3 seconds, which is far better then the initial 10 seconds.But I am keep investigating.