Web Files Best Practices
Web File size limit
By default, the Web File size limit is configured to be 256 Kb, see Web Files Configuration. On purpose, this value is not very high. Why?
If you have large videos, documents, or images, avoid storing them in Web Files, or even in the CMS as gallery item or asset. Instead, consider integrating with a dedicated digital asset management (DAM) tool.
If you want to reference a static webapp file (below /site/webapp/src/main/webapp) from a Web Files file, you need to use a relative path. The relative path is as follows:
Assume you have a Web File as follows
/repository-data: /webfiles: /src: /main: /resources: /site: /css: /style.css:
and style.css needs to import a 5 Mb never changing bootstrap.css, then, you can better not store this never changing bootstrap.css in Web Files. Instead, store it at
And in style.css import is as follows:
If you would had expected one ../ less, this is because one ../ is there to account for the path segment containing the anti-cache timestamp in the URL for style.css.
Web Files folder size
For local development, we tested with 1000+ small files in a single folder. Adding / removing / updating files is fast for quite large number of files in a single folder. Some operations however are more expensive than others. For example deleting a file in a folder triggers the folder to be re-imported. The more files a folder contain, the longer it will take. Likewise, the large the files are, the longer it will take. Hence we advice to keep the number of files within a folder not too large, and create subdirectories, for example when you have more than 100 files in a single folder. Note that on production it does not really matter, but most specifically during local development.