#1 2008-01-01 20:27:21

ruud
Developer emeritus
omega
Real name: Ruud van Melick
From: a galaxy far far away
Known languages: li,nl,en,(de)
Website

rvm_css (v0.5)

This plugin automatically stores a copy of your style sheet(s) as a static file. Static files are served several orders of magnitude faster than PHP files (200 times faster, in my own tests on a FastCGI-based server).

I originally wrote this plugin for a website that had two style sheets for every page (one for printing) and the built-in method of serving both style sheets cost as much CPU time and memory as serving the page itself. The server load for this website was reduced by 50% after using this plugin.

Download

Changelog:

  • version 0.1 (2007-06-11) [never released]
  • version 0.2 (2008-01-01)
    • file name sanitized
    • deleting a style sheet deletes the corresponding static file
    • degrade gracefully if static file cannot be stored or read
    • save style sheet in all situations (not just when saving an existing raw css file)
  • version 0.3 (2008-01-02)
    • return stylesheet url when format attribute is not set to ‘link’ (didn’t work before)
    • do not force the use of ‘default’ style sheet on 404 error page
  • version 0.4 (2008-12-20)
    • use correct CSS content when copying or saving a new style sheet (thanks Maniqui/Julián)
  • version 0.5 (2009-12-19)
    • compatible with future versions of TXP that may not use base64 encoding anymore when storing the style sheet in the database.

Offline

 

#2 2008-01-01 20:35:42

Bloke
Developer
omega
Real name: Stef Dawson
From: Coventry, UK
Known languages: Engl(ish)
Website

Re: rvm_css (v0.5)

Genius. Nice one, Ruud. I wonder if stm_javascript can be given the same treatment?

Last edited by Bloke (2008-01-01 20:36:24)


The smd plugin menagerie — for when you need one more gribble of power from TXP.

TXP Builders – finely-crafted code, design and txp

Offline

 

#3 2008-01-02 00:45:17

iblastoff
Plugin Author
tau
Real name: Steve Lam
From: Toronto
Known languages: en
Website

Re: rvm_css (v0.5)

beautious! will test this out when i can. but this is definitely gonna be another staple for my txp installations.

Offline

 

#4 2008-01-02 03:00:31

Gocom
Moderator
omega
Real name: Jukka Svahn
From: Finland
Known languages: EN, FI
Website

Re: rvm_css (v0.5)

Great, the must have thing, indeed.

Cheers!


Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />

Offline

 

#5 2008-01-02 03:10:54

thebombsite
Plugin Author
omega
Real name: Stuart
From: Walsall, England
Known languages: Doh!
Website

Re: rvm_css (v0.5)

Oh sorted Ruud. :)

Last edited by thebombsite (2008-01-02 03:36:24)


Stuart – the bombsiteJust Another Theme

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

 

#6 2008-01-02 04:24:40

nardo
Member
nu
From: tuvalahiti

Re: rvm_css (v0.5)

fantastic

Offline

 

#7 2008-01-02 06:11:10

NeilA
Member
iota
Real name: Neil Atwood
From: Blue Mountains, Australia
Website

Re: rvm_css (v0.5)

Thanks for this Rudd… but having a small problem getting it to work with a template by Reid…
Plugin is installed, activated, and the css files have been created.

This is what is currently in the page head referring to css:

bc..
<style type=“text/css” media=“screen”>

@import url(”<txp:css n=“grs1_primary” />”);

</style>

<txp:hide> —————————————————————————————-
Conditional comment to serve style sheet to IE 6.0 and under
————————————————————————————— </txp:hide>

<!—[if lt IE 7]>

<style type=“text/css” media=“screen”>

@import url(”<txp:css n=“grs1_ie” />”);

</style>

<![endif]—>

Simply replacing the <txp:css with your tag doesn’t work – I end up with no css being used at all.
Can you explain what I’m doing wrong?

Many thanks


Neil – Blue Mountains, Australia

http://westserve.org
http://ministrygrounds.net.au

Offline

 

#8 2008-01-02 08:01:42

ruud
Developer emeritus
omega
Real name: Ruud van Melick
From: a galaxy far far away
Known languages: li,nl,en,(de)
Website

Re: rvm_css (v0.5)

Can you send me the tag trace + the rest of the generated HTML code for that page by email?

Offline

 

#9 2008-01-02 08:30:02

NeilA
Member
iota
Real name: Neil Atwood
From: Blue Mountains, Australia
Website

Re: rvm_css (v0.5)

Will do Rudd, thanks.


Neil – Blue Mountains, Australia

http://westserve.org
http://ministrygrounds.net.au

Offline

 

#10 2008-01-02 09:52:54

jstubbs
Moderator
omega
Real name: Jonathan
From: Barcelona
Known languages: en-gb, es-es, fr-fr
Website

Re: rvm_css (v0.5)

Fantastic plugin! Thanks Ruud. Any chance of expanding this to the JS files in stm_javascript?


TXP TipsTXP MinimaTXP Minima PhotoblogMy pagePro Tennis Jobs

TXP Builders – finely-crafted code, design and txp

Offline

 

Powered by PunBB
© Copyright 2002 – 2005 Rickard Andersson