This patch move CSS and JS aviable into header in mirror url; patch change file:
- include/bootstrap.inc
- include/commont.inc
Usage
- apply patch to file
- add into settings.php for current file the code
$base_url_mirror[] = 'http://static1.mysite.tpl'; $base_url_mirror[] = 'http://static2.mysite.tpl'; // ...change path name for static. Use one or more static domain, encrease number of static domain can slow down performance (long dns lockup time response).
- Configure your mirror server to copy all static file (css, js, images) or link your static DNS to main directory.
Scope
Using this patch to encrease performance:
- http://developer.yahoo.com/performance/rules.html#split
- http://yuiblog.com/blog/2007/04/11/performance-research-part-4/
TO-DO
Static domain are random from aviable url mirror, and is not the best because user must download the same file different time if url mirror change into different page, but if use only two or tree url mirror it work fine.
| Comment | File | Size | Author |
|---|---|---|---|
| static_css_js.patch | 5.04 KB | mavimo |
Comments
Comment #1
kbahey commentedJust pointing out other approaches to this for your review, and possibly refine your patch based on what you read.
http://drupal.org/project/cdn
http://tag1consulting.com/patches/cdn
Comment #2
mavimo commented@kbahey:
this is a just consideration, but CDN is a "BIG" feature, this is so small, I try to add some correction (use JS and CSS specification) after some day.
tks for reply, i start to study CDN module, it's very intresting!!!
Comment #3
dave reidMoving feature request to 7.x.
While this feature request is small, I don't think it is core appropriate for the majority of sites out there. This seems much like a contrib appropriate feature. Plus this would be even easier with the proposed hook_css_alter and already implemented hook_js_alter.
Comment #4
mdupontGiven how old this issue is and given that contrib modules are already covering this feature (and more, such as putting uploaded files on CDN), I'm closing this issue.