I'm looking for broad feedback. It would be great to have a variety of people try using this, and let me know what they liked, what problems they encountered --anything, from start to finish.
some context to the issue is here.
Two main objectives for this script:
1. Combine resources into fewer HTTP requests, while minimizing total file size by excluding unneeded items.
2. More importantly, provide a CMS with an easy way to dynamically specify which resources are needed in any particular instance.
For example, the framework that I'm developing alongside this script has a method called
addResource() that the system (or add-ons) can use to specify a resource that they need, which would be added to the request.
Site-wide resources would still go in "global.css" or "global.js" files, but page-specific resources would be written (and then cached) as needed, automatically.
You're right, if you only have a few resources for a page, you could easily do what this script does on your own.
As a tool for a CMS, where content is generated on-the-fly depending on the request, I'm hoping this would work well to help manage everything.
I've used earlier versions of this on several projects in the past, and I'm happy with how it helps keep things straight: no missing, extra, or duplicate resources.
(Actually, I should add a check in this script to prevent reading the same resource twice...)