Now, my blog is on a SLOW connection, on a slow machine, so I can use every ounce of speed I can get, and I came up with this handy little optimization:
- In the current theme you are using, copy the style.css to main.css.
- Change style.css to this: @import "/templates/your-theme-dir/main.css;.
- View the text of http://yourblogdomain/serendipity.css. Ideally you should just have the @import directive.
- If you don't that means that some plugins are defining their own default styles. To make sure the directives in your /main.css override them properly, you can just put the name of the class in a comment. For instance, I override the defaults of the FreeTag and searchQuery plugins in my style.css. So, my main css looks like this:
Code: Select all
Be careful that you only do this trick for styles you actually over-ride.
The benefits of this are twofold. First of all, your css files can be properly cached. I checked it out in my apache logs, and low and behold, a GET to /templates/midibuffer/main.css returned a 304. The second benefit, is that the css event hook sends the entire contents of the css to each event (that asks for it), and the event will usually parse that string to see if any styles were overridden, and if not insert their own. Obviously if you are passing around and parsing a 112 byte string, its far faster then a 5K string. This part of the optimization might be minimal though.
Hope that helps!