Blocks css/js - reduce of HTTP requests
Permalink"THE PROBLEM" - i dont want to add HTTP req for blocks (css and JS). My blocks use the global css of the site (i change the selectors namespaces of view.php to fits this).
In one of the block i download i see this code outline (VIEW.PHP) with inline css & js:
<style> my inline css her </style> <script> my vars my (vars) Initialize and the complete script </script> <!-- the markup --> <div> <h1>my output markup </h1> </div>
This is good solution?
I dont understand how c5 handle HTTP requests of block assets and what is the best way to work for good performance/minimize-http-requests.
In other words - If i have in one page - 5 difference blocks - each block with css in the root of the block = I get 5 more HTTP requests ?
If you need to control CSS and JavaScript based on user input. I believe inline CSS and JavaScript is fine.
For more information on concrete5 asset handling, I recommend reading this section of the documentation:
http://documentation.concrete5.org/developers/assets/overview...
When you use CSS and JavaScript cache registered block assets will be combined. This discussion shows an example of how it works:
http://www.concrete5.org/community/forums/5-7-discussion/asset-cach...