Website optimization; css/js ordering

Permalink
Hi all,

I would love to get ideas on how to go about the following in Concrete5:

1. Combine css files into a single file before rendering the webpage.
2. Optimize the order of css files ensuring they are all loaded before any scripts in the header section.

I would like a custom solution for the above although other solutions are available notably Miser.
I am looking for an approach to enable developers specify the order of css/js in c5.
How can one access all css and or js files specified for a page before the page is rendered?

Regards,

Martin