Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other If multiple pages are using the same css file,does it load one time?

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #175280
    Shobhit_Geek
    Participant

    I am creating a site which has like 7-8 pages.I want to use the same custom font for all the pages.So what i am doing is that i am creating a css say temp_font.css and loading font in this using @font-face.Now my every page is having a reference of this css.When i switch between pages this css file would load again and again or the already loaded css would be used by the pages?

    #175358
    Anonymous
    Inactive

    @wolfcry911

    I have a question along these lines. For a site of more than 7-8 pages, or even that, is just having one CSS file for all that can use the same one good practice? What if the file becomes damaged? Sure, there should be a backup but if each page has its own CSS file then any corruption would be to a single page and easily fixed by grabbing the CSS file of a similar page. Besides, just how long of a lag can an average CSS file have to download time and again?

    Best Regards.

    #175631
    maikelkoopman
    Participant

    You can use one css file for unlimited amount of pages. because you download the css once with the first page load, the user doesn’t have download it again and again for every new page. It generally stays in the browser cache for at least a month or so, and the user will only see new css if the site changes the reference to the css in the document, eg change the file name OR they do a page refresh. There is no worry about a file being damaged, I have never seen this. So I wouldn’t worry too much about these things.

    #175634
    Anonymous
    Inactive

    Greetings, and thanks for the reply.

    I guess for a site of a few pages there might be an advantage to this, but I just don’t see that CSS would take such a long time to download, even if the same CSS was used for every page of a 20 – 30 page site (which would be unlikely if scrolling, slideshows, etc., were used on some) that there is any great benefit.

    If a person makes only one CSS for all pages and makes a mistake on it when updating or changing it, then all pages are potentially ruined. If each page has its own CSS, whether the same as others or not, then one could easily be brought over from another file. Yes, a backup of a site and all files should be created, but that isn’t always done and if it is, changes to a site aren’t always backed up.

    JMHO. Thoughts?

    #175807
    Anonymous
    Inactive

    Many thanks @maikelkoopman and @MattDiMu,

    Food for thought.

    #175818
    Shobhit_Geek
    Participant

    Thanks for helping me guys!
    It means a lot :)

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Other’ is closed to new topics and replies.