Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-07-23 19:14:22

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,157
Website

pat_speeder

Did you ever seen the source of Google’s html page? For speed reasons, Google is serving all its home page into one line of code. The benefit is a server bandwidth gain. So what don’t we make the same for ours TXP websites?

Just activate this plugin and your page templates and database css files will be served into one line of code.

Note. It’s my very first plugin. A very simple one. Be Nice. Comments are welcome.

Versions History:

pat_speeder_v0.1 Very simple beta realize (22 Jul 2009).
pat_speeder_v0.2 Add some suggestions from Ruud (24 Jul 2009).
pat_speeder_v0.3 Mask your html/css comments but preserve specific IE conditional comments (28 Jul 2009).
pat_speeder_v0.3.a The array had been changed by a stronger regex. Spaces between html elements and characters content are now preserved (i.e. <img src="... /> <a href=""...). This version is the pre final one. It’s strongly recommanded to use it. Tks. (28 Jul 2009).

Final realize: pat_speeder_v0.3.b Add support for <pre> tags (30 Jul 2009). Finaly your better choice

Special “Non-Intrusive Realize”: *pat_speeder_v0.4*: Need to be added at the very top of each page templates (<txp:pat_speeder enable="boolean" />). Support on demand boolean 1 or 0 into “enable” attribute to choose which page to process. No compressing for CSS database files (29 Jul 2009). If you need to compress your CSS files, tell me: I have a solution.

Latest: version 0.4.c support for “HTML5/Boilerplate” doctype declaration method added into regex (06 Jul 2011).

The promotional website

Have fun.

Last edited by Pat64 (2015-05-06 13:52:05)


Patrick.
Txp Tricks & Tips by french users : http://txp-fr.net | G+
Github

Offline

#2 2009-07-26 09:16:41

lee
Member
From: Normandy, France
Registered: 2004-06-17
Posts: 831

Re: pat_speeder

Thanks Pat64.

Offline

#3 2009-07-26 09:40:26

ruud
Developer emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,057
Website

Re: pat_speeder

Now that’s a small plugin!

How much bandwidth does this save if the website serves the pages using compression?

People who use pre-formatted text on their website shouldn’t use this plugin.

Offline

#4 2009-07-26 09:52:06

lee
Member
From: Normandy, France
Registered: 2004-06-17
Posts: 831

Re: pat_speeder

ruud wrote:

People who use pre-formatted text on their website shouldn’t use this plugin.

Hi Rudd, what do you mean by pre-formatted text and why should it be used?

Thanks
Lee

Offline

#5 2009-07-26 09:59:39

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 6,225
Website

Re: pat_speeder

lee wrote:

what do you mean by pre-formatted text and why should it be used?

Hi Lee,

I guess (please someone do correct me if i am wrong or if i missed something) what ruud says is for people who use tags like bc. or the html <pre> or <code> tags should not use this plugin.


Yiannis
——————————
neme.org | hblack.net | LABS | NeMe @ github

Offline

#6 2009-07-26 11:07:49

ruud
Developer emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,057
Website

Re: pat_speeder

^^ yes, that’s what I meant.

Offline

#7 2009-07-26 12:33:59

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,157
Website

Re: pat_speeder

ruud wrote:

Now that’s a small plugin!

First. Sure! It’s my first one. I need to start with something :)) And now I’ll could go working on a bigger one…

Second. Thx for your warning.

On your recommendation – in the purpose to see what’s will occured – I’d try to add this into an article ( “Welcome to your site” on a fresh TXP 4.2.0 install):

bc. Test
 <pre><code>Test </code></pre> (starting line with a space for no textile rendition)

I’ve got this (as expected) within my source when this plugin is activated:

<pre><code>test </code></pre> <pre><code>Test </code></pre>

Could you tell me what’s the problem.

Best regards,

Last edited by Pat64 (2009-07-26 12:44:54)


Patrick.
Txp Tricks & Tips by french users : http://txp-fr.net | G+
Github

Offline

#8 2009-07-26 12:54:09

ruud
Developer emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,057
Website

Re: pat_speeder

Check how it looks in the browser, not in the HTML code. The plugin shouldn’t affect how it looks for the visitor of the website.

Before:

<pre>three
separate
lines</pre>

After (well, not exactly, but you get the idea):

<pre>one long line</pre>

PS. the ‘small plugin’ comment was a compliment. I like small plugins.

Offline

#9 2009-07-26 13:45:36

net-carver
Member
From: UK
Registered: 2006-03-08
Posts: 1,648

Re: pat_speeder

Patrick

Great to see you publishing your first plugin — congratulations!

Ruud wrote:

How much bandwidth does this save if the website serves the pages using compression?

Just like Ruud, I’d love to see some stats on the speedup this one gives. Are there any stats available for bandwidth reduction and/or time taken to process HTTP requests?


Steve
Textile | My plugins on GitHub | @netcarver

Offline

#10 2009-07-26 14:32:16

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,157
Website

Re: pat_speeder

ruud wrote:

Check how it looks in the browser, not in the HTML code. The plugin shouldn’t affect how it looks for the visitor of the website.

Before:

<pre>three
separate
lines</pre>

After (well, not exactly, but you get the idea):

<pre>one long line</pre>

-> Oh Yes I see now. You’re right Ruud (as always ;)

Thx lot.

net-carver wrote

Just like Ruud, I’d love to see some stats on the speedup this one gives. Are there any stats available for bandwidth reduction and/or time taken to process HTTP requests?

No stats. I’d just “see” (shame on me) a better page rendition for the 4 live websites I tested (even on one with a compressor.php script for javascript and css files)


Patrick.
Txp Tricks & Tips by french users : http://txp-fr.net | G+
Github

Offline

Board footer

Powered by FluxBB