published server CSS loading issue.

Avatar

Avatar

imadullakhan

Avatar

imadullakhan

imadullakhan

31-07-2020

Hi @All

 

I have published servers, in that if i am accessing as a anonymous user then the pages css is not coming like page and component level css is not loading, once i logged in the server as ADMIN or someother user then the pages with css is loading. Can anyone help me here..?

View Entire Topic

Avatar

Avatar

BrianKasingli

MVP

Avatar

BrianKasingli

MVP

BrianKasingli
MVP

03-08-2020

@imadullakhan,

Adobe recommends client libraries should be stored in the /apps folder for example, /apps/weretail/clientlibs/clientlib-site. While utilising the client library utils from Sightly to serve the client library, the rendered CSS file will look like /apps/weretail/clientlibs/clientlib-site.css, this is because you have not enabled the proxy configuration for the client library. In your publish environment, you are not able to access the client library file is because for security purposes. The /apps folder is restricted to the public; the /apps folder, recommended by Adobe, is a non-public-accessible zone. A simple fix will be to append the "allowProxy" attribute to your client library:

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
    jcr:primaryType="cq:ClientLibraryFolder"
    allowProxy="{Boolean}true"
    categories="[we.retail.site]"/>

 

Once the allowProxy attribute and value have been declared, the sightly client library utils will serve the client library via proxy, serving /etc.clientlibs/weretail/clientlibs/clientlib-site.css|js. ^/etc.clientlibs/* can be accessible by the public.

I hope this helps,
Brian.