What is the appropriate methodology for combining js files for production?
For example, I have some files (lets call them Category A files) that are used on all pages in the app, and some files (called Category B files) that are only used on 3 or 4 pages.
Given that I am minifying and caching (and combining where appropriate) all js files, should I:
- Combine the Category B files with the Category A files into a single cached file; or
- Always serve the Category A files, and only serve the Category B on those pages that need them?
I suspect that option 1 is the preferred route, but I just wanted to double check.
Conbining them into one and minifing it, it’s probably the way to go.
Less files on the page request.