-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Description
Right now we have some apps providing small pieces of javascript on each page load. Examples for this are the theming and accessibility. But in the future the mainly loaded js file of the firstrunwizard (nextcloud/firstrunwizard#106) will also be tiny.
In my opinion is makes most sense to inline those tiny scripts as much as possible to get the request count down. Given they are small enough of course.
I would propose a similar approach as we do with the capabilities. We provide an interface (one for JS and one for CSS). And an app can register their stuff to inline easily.
During the rendering of the templates we can then decide on a case by case basis (using some metrics) if we want to inline.
- Does the browser support CSPv3?
- Is the script/css not to big?
If not all criteria are met we can still chose to call a route that will simple server the same css/js for an app.