Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

css pages cached

Options
  • 20-01-2009 5:49pm
    #1
    Closed Accounts Posts: 174 ✭✭


    Are css pages cached ?

    I have a site which reloads the pages as you navigate through it (dynamically generated content displayed in html).
    Is the css file reloaded every time the page is loaded or is it cached ?

    Want to know if it's best to have one big css file that's loaded once and cached or several small ones for each page.

    Thanks


Comments

  • Registered Users Posts: 467 ✭✭nikimere


    I've found generally they don't get cashed.
    However, if you can i'd break them up to multiple files. For example if you have loads of css stuff that's only used on say the contact page it's better to only load the contact.css on that page.


  • Closed Accounts Posts: 18,163 ✭✭✭✭Liam Byrne


    nikimere wrote: »
    I've found generally they don't get cashed.
    However, if you can i'd break them up to multiple files. For example if you have loads of css stuff that's only used on say the contact page it's better to only load the contact.css on that page.

    Not "only", no.

    Have ALL "common to all pages" CSS in one file.

    Then, by all means, have individual ones for individual pages to style those pages' unique objects.

    Then load both stylesheets. Makes site-wide and page-wide updating easier without having the huge overhead for all the finicky bits on the individual pages.

    Mind you, if the pages were reasonably consistent it wouldn't be a huge issue, but if you have something like a slideshow on one page, then no - there's no point loading its CSS on every page.


  • Registered Users Posts: 467 ✭✭nikimere


    Liam Byrne wrote: »
    Not "only", no.

    Have ALL "common to all pages" CSS in one file.

    Then, by all means, have individual ones for individual pages to style those pages' unique objects.

    Then load both stylesheets. Makes site-wide and page-wide updating easier without having the huge overhead for all the finicky bits on the individual pages.

    Mind you, if the pages were reasonably consistent it wouldn't be a huge issue, but if you have something like a slideshow on one page, then no - there's no point loading its CSS on every page.
    We're saying the same thing, maybe i could have structured my post better.
    What i was trying to say that the only time you should load the contact.css is on the contact page.


  • Closed Accounts Posts: 174 ✭✭patftrears


    update on this changed to inline css for each page

    So it was loading the css file with each page

    was
    12kb * 40k pages per day = 460mb
    now average
    4.5kb * 40k pages per day = 170mb

    so saved 290mb traffic per day

    also
    saved 40k requests to the server per day downloading the additional css file

    After seeing the figures I am now going to remove most of the images from the pages, won't look as pretty but the savings will be massive.

    Going to remove tabs/spaces from the html pages.

    Any other tips to reduce size/requests ?


  • Registered Users Posts: 2,119 ✭✭✭p


    What kind of site are you running that saving bandwidth is such a huge issue that you should ruin the design over it?

    Also, did you say you changed to inline css - becasue that means something entirely different than what people suggested.


  • Advertisement
  • Closed Accounts Posts: 174 ✭✭patftrears


    p wrote: »
    What kind of site are you running that saving bandwidth is such a huge issue that you should ruin the design over it?

    Also, did you say you changed to inline css - becasue that means something entirely different than what people suggested.

    It's an online business management tool, so people go in and get the job done and leave, there are 2 level of users this is for the lowest level who only have to perform basic tasks.

    Removing images will not affect the design, usability or functionality just not as pretty. Design incorporates images, images are not design.

    using <style> </style> instead of pulling in style sheets.

    It's not just bandwidth it's server resources, less requests,files to serve which will impact costs, scalability and performance.


  • Registered Users Posts: 2,119 ✭✭✭p


    patftrears wrote: »
    It's an online business management tool, so people go in and get the job done and leave, there are 2 level of users this is for the lowest level who only have to perform basic tasks.

    Removing images will not affect the design, usability or functionality just not as pretty. Design incorporates images, images are not design.
    Design is everything, it's the whole package If something looks nicer then people think it's easier to use. I doubt you can strip out every image out of a site and preserve it's quality.
    using <style> </style> instead of pulling in style sheets.

    It's not just bandwidth it's server resources, less requests,files to serve which will impact costs, scalability and performance.
    Moving everything into the style tag will result in less requests, but it will also result in higher costs and lower performance. In fact, you did the opposite of what people were suggesting.


  • Closed Accounts Posts: 174 ✭✭patftrears


    p wrote: »
    Design is everything, it's the whole package If something looks nicer then people think it's easier to use. I doubt you can strip out every image out of a site and preserve it's quality.
    I have a very good designer who knows his stuff, I'm confident he will do a great job. Like I said images are an enhancement not the only thing involved in good design.
    p wrote: »
    Moving everything into the style tag will result in less requests, but it will also result in higher costs and lower performance.
    Present any facts or examples to back up these wild assumptions and I will show you the error of your thinking.


Advertisement