The generated pages would perform better and be more organized.
Say, I have few tab containers in page. Currently I can inject JS and CSS files (assets) only in first shortcode (thanks for the invocation count), but assets are not injected in header, causing
- browser cannot load them in advance, slowing down the page
- assets injection are not organized inside header
If, in the template, I can know if the shortcode is invoked, I can inject assets in header to avoid the above these two problems.
UPDATE: One more problem, the generated pages may come with JS bugs because same assets are loaded multiple times.
If there are more than one types of shortcode, maybe tab containers and charts, that depend on same assets, those assets would be loaded twice and may causing errors. For example, loading jQuery with
<script> tag more than once causes error.