One CSS file for many sites... good or bad?

11 replies
  • WEB DESIGN
  • |
Hi all...

A quick question...

If you have 50 or 500 sites, and all use the same theme. Would having them all share the SAME css file (example: abcdomain.com/global.css), slow things down, or speed things up, or have little or no effect on server response?

Many thanks,

~wickedsam
#bad #css #file #good #sites
  • Profile picture of the author ImagineMonkey
    Originally Posted by wickedsam View Post

    Hi all...

    A quick question...

    If you have 50 or 500 sites, and all use the same theme. Would having them all share the SAME css file (example: abcdomain.com/global.css), slow things down, or speed things up, or have little or no effect on server response?

    Many thanks,

    ~wickedsam
    It would have little effect. The purpose of having a css file is in order to help thin out your HTML code. Back in the day, web designers used to have to add design elements into their HTML. CSS files were created to make it easier for you to customize page designs and modify design elements of a website without bloating up your HTML.

    And a CSS file on a server is nothing. When you begin talking about hosting HD media files with a high traffic volume, then you should worry about server performance.
    Signature
    Imagine Monkey: Designing websites, one banana at a time.

    http://www.ImagineMonkey.com
    {{ DiscussionBoard.errors[6796419].message }}
  • Profile picture of the author tweakr
    Probably little to no effect. Unless your visitors are going to be visiting many of your sites, having the CSS cached wouldn't be much of an improvement.
    Signature

    Free AdPress Theme for WordPress .

    {{ DiscussionBoard.errors[6796602].message }}
  • Profile picture of the author tomm
    I think that is good, i do a similar thing, in all my most recent sites I pull Yahoo's CSS, one css to reset all, another one to set up fonts and another one for a layout framework

    http://yui.yahooapis.com/3.4.1/build...sreset-min.css
    http://yui.yahooapis.com/3.4.1/build...sfonts-min.css
    http://yui.yahooapis.com/3.4.1/build.../grids-min.css

    you can see more at: YUI User Guides
    {{ DiscussionBoard.errors[6796620].message }}
    • Profile picture of the author wickedsam
      So I could have 500 sites all pointing to one single css file?

      And if there was say a 100,000 visitors in a month, all accessing the same file... would it not cause any problems or slow anything down that could have been averted by having 500 css files?

      I'm just trying to be sure, as I can see the benefit of having one css file, but am wary of affecting so many customers experiences.

      Many thanks for you help!

      ~wickedsam

      Appropriate quote: "If I have seen farther it is by standing on the shoulders of giants." - Isaac Newton
      {{ DiscussionBoard.errors[6798110].message }}
  • Profile picture of the author prtt75
    no effect. but css file is just a text file, comes in small file size, why do you have to share it among 500 sites?
    {{ DiscussionBoard.errors[6798258].message }}
  • Profile picture of the author Azlan
    Using one css will also help you on maintenance
    Signature

    New WSO - Coming Soon...

    {{ DiscussionBoard.errors[6799229].message }}
    • Profile picture of the author ronc0011
      I'm curious hat you mean by sharing a single file are you saying that you have a single file that resides at http://www.some domain.com and so pages on your other site have a link statement something like

      Code:
      
      <link href="http://www.some domain.com/CSS/rules.css"rel="style sheet"type="text/css"/>
      
      Is this what you're saying? if so then you have o also consider that this is making a call to the internet. in other words your server is making an http request to another server that resides somewhere out on the internet. It' doesn't really matter if the server is sitting right beside it or even if it is actually the same server as itself it is still making a request for a machine that has to be resolved by internet name servers.. Whereas the normal link statement would use a relative path to the local machine / harddrive.
      {{ DiscussionBoard.errors[6800130].message }}
      • Profile picture of the author tomm
        Originally Posted by ronc0011 View Post

        I'm curious hat you mean by sharing a single file are you saying that you have a single file that resides at http://www.some domain.com and so pages on your other site have a link statement something like

        Code:
        
        <link href="http://www.some domain.com/CSS/rules.css"rel="style sheet"type="text/css"/>
        
        Is this what you're saying? if so then you have o also consider that this is making a call to the internet. in other words your server is making an http request to another server that resides somewhere out on the internet. It' doesn't really matter if the server is sitting right beside it or even if it is actually the same server as itself it is still making a request for a machine that has to be resolved by internet name servers.. Whereas the normal link statement would use a relative path to the local machine / harddrive.
        it is actually the browser that is making the requests, not the server, right? if so, for the browser, it really doesn't matter if it's making a request to the same server as the site or some other server
        {{ DiscussionBoard.errors[6802181].message }}
        • Profile picture of the author ronc0011
          Originally Posted by tomm View Post

          it is actually the browser that is making the requests, not the server, right? if so, for the browser, it really doesn't matter if it's making a request to the same server as the site or some other server
          well actually that depends. In the case of a static page that is correct however in the case of a dynamic page such as a PHP page where the call is made by the scripting language or even an ASP page where again the call is made by the code behind script. But yeah in the case of a straight html mage it is the browser or visitors machine that is making the request. But in the case of a Wordpress site I'm pretty sure it's the server that is making the request.
          {{ DiscussionBoard.errors[6802398].message }}
          • Profile picture of the author ClicProject
            It should have a negligable effect on load times, unless you are getting many thousands of hits a day.

            But, for the sake of argument:

            -The performance would depend if all the domains are on the same server, or if they are scattered accross several hosting packages. If they are on the same server, it wouldn´t really make any difference, as the server would have to serve the file whether it came from one domain or the other. If, however, you had, say, 10,000 sites all located on different hosting, all calling the same css file on one single hosting, it would cause a performance problem and you should add the css to each individual site.

            -Browsers have a limit to the amount of concurrent http requests they can make to the same server, so if the css file is on a different server, it would actually make the page load faster (hence the use of CDNs or Content Delivery Networks on high volume sites).

            -In response to ronc0011, you are incorrect in your dynamic code argument. All your code will do is serve up an address to the css file, it will still be downloaded by the browser.
            {{ DiscussionBoard.errors[6802689].message }}
            • Profile picture of the author ronc0011
              Originally Posted by ClicProject View Post

              It should have a negligable effect on load times, unless you are getting many thousands of hits a day.

              But, for the sake of argument:

              -The performance would depend if all the domains are on the same server, or if they are scattered accross several hosting packages. If they are on the same server, it wouldn´t really make any difference, as the server would have to serve the file whether it came from one domain or the other. If, however, you had, say, 10,000 sites all located on different hosting, all calling the same css file on one single hosting, it would cause a performance problem and you should add the css to each individual site.

              -Browsers have a limit to the amount of concurrent http requests they can make to the same server, so if the css file is on a different server, it would actually make the page load faster (hence the use of CDNs or Content Delivery Networks on high volume sites).

              -In response to ronc0011, you are incorrect in your dynamic code argument. All your code will do is serve up an address to the css file, it will still be downloaded by the browser.

              Actually being on the same server isn't going to make any difference if you look at the example I gave It is making an HTTP request to a machine on the "www" world wide web". It is not using a relative address or a local folder path. in any event that call is going out to name servers on the internet to get the domain name resolved and then the request is routed to the proper server.

              For instance at one time I was running a web server on my desktop machine using IIS and a Dynamic DNS service called Zoneedit so even though I was hosting my websites on my desktop machine sitting right there beside me when I visited my website my http request still went out on the internet to find its way back here. So my machine had to send my website out on the internet to get it back here to me on my machine i.e the web server.
              {{ DiscussionBoard.errors[6803084].message }}

Trending Topics