Forums

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

Home Forums CSS Is it better to manually add the contents of google fonts stylesheets?

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #235957
    Alex Zaworski
    Participant

    I ran into this earlier today— is it more performant to add the contents of a stylesheet from google fonts (eg this one) and save your self the request or to include it as a link? I’d assume the former but I don’t usually see that done.

    All of this assuming, of course, you’re not loading them async

    #235958
    Shikkediel
    Participant

    I guess it mostly depends on how fast your own server is…

    #235959
    Alex Zaworski
    Participant

    Why would that change anything? It’s still loading the fonts from google’s servers, but as far as I can tell this dodges a request for the css file (assuming you add it to the rest of your styles).

    edit: I suppose if your server were slow enough that it took more time to serve the ~4k than it took to request + download from google then that would make sense.

    Also I guess if the URL for the font sources ever changed you’d be preeeeetty screwed.

    #235960
    Shikkediel
    Participant

    I suppose a single request plays less of a role than response time and other optimisation (compression for example). A caching advantage is likier to be the case if you use a CDN for a JS library, not so much with fonts I think. So my own preference would be to serve them from the site itself.

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