Static files for internal and external consumption | Community
Skip to main content
New Participant
November 2, 2021
Solved

Static files for internal and external consumption

  • November 2, 2021
  • 1 reply
  • 901 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Asutosh_Jena_

Hi @supportmember 

 

/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!

1 reply

Asutosh_Jena_
New Participant
November 3, 2021

Hi @supportmember 

 

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!

New Participant
November 3, 2021

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_
Asutosh_Jena_Accepted solution
New Participant
November 4, 2021

Hi @supportmember 

 

/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!