Opened 21 years ago
Closed 21 years ago
#89 closed defect (fixed)
Including CSS in all generated pages causes excessive page sizes
Reported by: | Owned by: | daniel | |
---|---|---|---|
Priority: | normal | Milestone: | 0.5.2 |
Component: | general | Version: | 0.5.1 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
The ability to have "dynamic" CSS, introduced in #50, is nice but it comes at the expense of usability. By including 10Kb of CSS in every generated page, load times are excessive.
Using an external CSS file, <link rel='stylesheet' type='text/css' ... />
, allows the web browser to cache the CSS. Dynamic CSS could be catered for in the current fashion: including it in the generated HTML between <script> </script>
tags. Alternatively, the HTML and CSS could be reworked so that there is no need for dynamic CSS. A quick glance at svn:/trunk/templates/css.cs leads me to believe that dynamic CSS is used to avoid bloating the generated HTML by as much as possible.
Perfectly true, i didn't think of that immediately. It could be easily changed so the "dynamics" mentioned in #50 are achieved using simple @import-statements in the CSS instead. That'd be something of a best-of-both-worlds.
Caching is definitely more important than "slim" stylesheets though.