I had not thought of this issue. Good catch.  I have made the change to use anonymous resolver.

From: david g. [mailto:notifications@github.com]
Sent: Friday, February 07, 2014 7:30 PM
To: Adobe-Consulting-Services/acs-aem-commons
Cc: gopal Kalyanaraman
Subject: Re: [acs-aem-commons] Feature/site map generator (#117)


In bundle/src/main/java/com/adobe/acs/commons/sitemaps/impl/SiteMapGeneratorServlet.java:

> +        }

> +    }

> +

> +    protected void unbindSiteMapGenerators(

> +            final SiteMapGenerator siteMapGenerator,

> +            final Map<String, Object> props) {

> +        synchronized (this.siteMapGenerators) {

> +            this.siteMapGenerators.remove(PropertiesUtil.toString(

> +                    props.get(SiteMapConstants.DOMAIN_NAME),"localhost:4502"));

> +        }

> +    }

> +

> +    protected void doGet(SlingHttpServletRequest request,

> +            SlingHttpServletResponse response) {

> +        String currentDomain = request.getHeader("Host");

> +       Document siteMapDocument = this.siteMapGenerators.get(currentDomain).getSiteMap(request.getResourceResolver());

@kalyanar<https://github.com/kalyanar> Shouldn't this be the anonymous resourceResolver? If a logged in user (with access to non-public pages) hits this servlet, could a sitemap of non-public pages listed in it get cached in dispatcher? Or am i missing something? This feels like too expensive of a page to not cache.

I can't think of a real use case where you'd want non-anonymously accessible content in a sitemap.xml?

This of course would result in empty sitemaps on author but then again, sitemap.xml's arent useful there.

—
Reply to this email directly or view it on GitHub<https://github.com/Adobe-Consulting-Services/acs-aem-commons/pull/117/files#r9539046>.