- Make decision to prematurely optimize application
- Choose the least helpful optimization first
- Append the static asset text files with .php (AJS.jsmin.js.php in this case)
- Use the
header()
function to manage caching of static assets - Include new awesome cache controlled files in application
- Leave it to maintenance programmer to resolve all the “Cannot modify header information” warnings
1 2 3 4 5 6 7 8 9 10 11 12 |
|
(NOTE: The ellipsis above indicates snipped, minified javascript)
Along with promising to visit death upon developers using a technique like this, I’ll pass along at least one better idea. Here’s an alternative from Greg Aker in his post, “Bust ‘yo cache!”. Add yours in the comments