Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Static files for internal and external consumption

AEMWizard
Level 4
Level 4

My organization has a few JSON files that we like to re-use across out website. 
countries.json
countries_city.json
countries_zip.json
They will be used for the forms drop down, and some sort of backend logic.
Where is the best place to store these files.

We were thinking of /etc/designs/my-brand/static/*; what are your thoughts?

3 Replies
Asutosh_Jena_
Community Advisor
Community Advisor

Hi @AEMWizard 

 

As these are the content related stuffs, I will keep these under /content/my-brand/static/* folder and use it from there as needed.

 

This is how currently I use as well in my project when there is a requirement for static content reference.

 

Hope this helps!

 

Thanks!

AEMWizard
Level 4
Level 4

Thank you for the response, but

/content/my-brand/static/*  

 

should also be accessible to our public users too. Would you do some apache rewriting to [PT] the request to the files? what happens when an author accidentally publishes this file? Also we don't want the authors to see these.

Wouldn't /etc/designs/my-brand/static/* be the best place to keep the files?

 

Asutosh_Jena_
Community Advisor
Community Advisor

Hi @AEMWizard 

 

/content/my-brand/static/* content will be added via code and will not be visible to author in a readable format as it's not a cq:Page content type.

 

As it will be deployed via code, it will be available on both author and publish instance and we do not have to publish it manually. Publishing it also will not make any difference.

 

Direct access to /content/my-brand/static/* can be blocked in dispatcher by applying the rule.

 

Ideally we should not keep anything under /etc and all customized content should be stored under /content.

 

Thanks!