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 movies, pdfs, or images, instead of storing them in Web Files, rather store them in the CMS as gallery item or asset.
If you want to reference a static webapp file (below /site/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
+ bootstrap + 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.