This patch move CSS and JS aviable into header in mirror url; patch change file:

  • include/bootstrap.inc
  • include/commont.inc

Usage

  1. apply patch to file
  2. 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).

  3. 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:

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.

CommentFileSizeAuthor
static_css_js.patch5.04 KBmavimo

Comments

kbahey’s picture

Just 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

mavimo’s picture

@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!!!

dave reid’s picture

Version: 6.x-dev » 7.x-dev
Status: Needs review » Needs work

Moving 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.

mdupont’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)

Given 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.