There is one important reason why we use <link> instead of <style>…</style>: when the rendered page HTML is cached, e.g. using a caching proxy like Varnish [1] or MediaWiki file cache [2], then if we used <style>…</style>, you would have to purge every page on the wiki before changes to MediaWiki:Common.css would actually take effect, because the CSS would be embedded in the cached HTML.

Using <link> means that it only takes as long as it takes the cached resource to expire in the users' browsers. (By default, they are set to expire after 5 minutes.)

If you don't have caching enabled, then of course that wouldn't matter – but also, if you don't have caching enabled, then that is probably a much worse performance problem than not embedding the styles :)

[1] https://www.mediawiki.org/wiki/Manual:Varnish_caching
[2] https://www.mediawiki.org/wiki/Manual:File_cache

--
Bartosz Dziewoński

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to