Optimize your stylesheet.
Posted: Thu May 19, 2005 6:08 pm
Because S9y has an event-hook for displaying the css, your css files are actually parsed php files. What does this mean exactly? Well your css files aren't cached, and on every page load, the serendipity.css.php file has to be re-parsed, and re-executed. The execution time could take a little while longer, depending on the plugins you are using as well.
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:
Hope that helps!
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:
Be careful that you only do this trick for styles you actually over-ride.
Code: Select all
@import "/templates/midibuffer/main.css"; /* .serendipity_searchQuery {} .serendipity_freeTag {} */
Hope that helps!