- Static content domain can be cookie-free.
- Cache settings can be adjusted specifically for the static content, based on host headers.
- Dedicated hardware could be set up to serve the static content.
In dev and QA environments, of course, it may not be possible to point to an external production domain. The CSS/JS/etc files may need to point to local content during dev/QA. Consequently, any solution should take into account configuration differences across environments.
A couple solutions to consider:
- Instrument IMG and SCRIPT links with a method call that substitutes the domain.
Drawback: <%= %> block in ASPX page means that it cannot be declared CompileMode="never", which is needed for CMS-generated pages.
Will a <%$ %> block work?
- Create an HttpModule to comb through the page output and substitute the domain in the proper locations.
- Implement an .ascx control to output SCRIPT and CSS references.
Drawback: Will not address the issue of inline IMG tags.
- Use a dynamic #include file with some logic embedded.
Drawback: Same as #3. Also, CMS user could possibly mangle code directives in #include. Finally, it is questionable if this will even work reliably with ASPX.