Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-08-06 15:50:18

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355

aks_header : Compress your pages on the fly. Strip white spaces + gzip

aks_header – Compress your pages on the fly.

Version 0.4.2 download link / homepage

Features:

  • Set any page headers. It’s useful for create your custom feeds.
  • Strip white spaces on the fly.
  • GZIP compress on the fly.
  • 301 redirect non exist pages or directories to other place.
  • Calculate and set Etag header
    .

Examples:

Place on top your page template

<txp:aks_header strip="1" gzip="1" /><!DOCTYPE html  . . .

or place on top your xml page template

<txp:aks_header name="Content-Type" value="application/rss+xml" strip="1" gzip="1" /><?xml version="1.0" . . .

Tests

Page Original size Strip white spaces GZIP Strip+GZIP
http://makss.uaho.net/plugins/aks_rss 16726 bytes 15385 bytes 4234 bytes 4039 bytes
Save space from original size 0 % 8 % 75 % 76 %

.

aks_301 – Simple 301 redirect with conditions

Summary

This tag useful for redirect non exist pages or directories to other place.
Default: to domain root.

Last edited by makss (2025-05-02 14:42:39)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#2 2009-08-07 09:38:44

Dandruff
Member
Registered: 2007-03-16
Posts: 18

Re: aks_header : Compress your pages on the fly. Strip white spaces + gzip

Thank you so much for this one!
Works perfectly on the 4.2.0 release candidate.

Offline

#3 2009-08-08 17:38:03

beztak
Member
From: Czech Republic
Registered: 2005-07-21
Posts: 184
Website

Re: aks_header : Compress your pages on the fly. Strip white spaces + gzip

Thanks for this great plugin.

Offline

#4 2009-08-11 20:32:36

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355

Re: aks_header : Compress your pages on the fly. Strip white spaces + gzip

New version aks_header 0.3.1

HowTo:

Last edited by makss (2016-01-16 18:34:54)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#5 2009-08-16 08:09:45

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355

Re: aks_header : Compress your pages on the fly. Strip white spaces + gzip

New version aks_header 0.3.2

  • Now plugin aks_301 included in aks_header (2 in 1)
  • Some minor changes

Last edited by makss (2016-01-16 18:35:23)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#6 2009-08-17 11:49:54

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355

Re: aks_header : Compress your pages on the fly. Strip white spaces + gzip

aks_header 0.3.2c

  • Add no-cache header
  • Add support multiple URLs for 301 redirect

Last edited by makss (2016-01-16 18:35:45)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#7 2009-08-22 21:39:07

beztak
Member
From: Czech Republic
Registered: 2005-07-21
Posts: 184
Website

Re: aks_header : Compress your pages on the fly. Strip white spaces + gzip

I don’t know if this is a bug but on one of my web I started to use your great aks_header plugin. But when active and insert into code (in any gzip/strip combination) it conflict with gbp_permanent_links plugin that I use to url rewrite – everything works – only parameter for “pg” is shown, so instead of:

www.domain.com/3/

I have:

www.domain.com/?pg=3

It only crush with pagination, all others url rewrite seems to be ok. Have somebody an idea why?

Offline

#8 2009-08-24 11:30:08

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355

Re: aks_header : Compress your pages on the fly. Strip white spaces + gzip

beztak wrote:

I don’t know if this is a bug but on one of my web I started to use your great aks_header plugin. But when active and insert into code (in any gzip/strip combination) it conflict with gbp_permanent_links plugin

Please, try it.

aks_header 0.3.3

  • Rewrite code for compatibility with gbp_permanent_links and some other plugins

Last edited by makss (2016-01-16 18:36:13)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#9 2009-08-24 11:53:07

beztak
Member
From: Czech Republic
Registered: 2005-07-21
Posts: 184
Website

Re: aks_header : Compress your pages on the fly. Strip white spaces + gzip

It is working now – as I wrote I had a problem with pagination here: www.ovsem.net but now with aks_header 0.3.3 it’s all right. Thank you.

Offline

#10 2009-09-19 16:56:39

nik.martin
New Member
Registered: 2009-09-06
Posts: 8

Re: aks_header : Compress your pages on the fly. Strip white spaces + gzip

Thanks for the plugin. Using your instructions, modified only for context, I added the ability to add external javascript files. I followed your instructions exactly. The only problem is taht the end of any javascript file gets this added:
<h2 id=“comment”></h2>

Which then of course appears to break my javascript, jquery.js in this case:
http://admin1.servercorps.net/js/jquery.js

Any ideas?

Offline

#11 2009-09-19 20:40:32

nik.martin
New Member
Registered: 2009-09-06
Posts: 8

Re: aks_header : Compress your pages on the fly. Strip white spaces + gzip

I think I found out what’s up: If Site Wide Comments are on (Admin > Preferences > Basic > Accept Comments), then an <h2 id=“comment”> is placed the bottom of EVERY article, regardless if comments are on for that article or whether “One By Default” is set to No, whic it is in my site. I think this is a bug in TXP, so I’m gonna check there. Otherwise, this totally breaks ANY use of aks_header for linking to normally external file in txp.

Offline

#12 2009-09-19 23:35:43

TheEric
Plugin Author
From: Colorado & Montana.
Registered: 2004-09-17
Posts: 603
Website

Re: aks_header : Compress your pages on the fly. Strip white spaces + gzip

Why is this any better than mod_gzip?

Offline

#13 2009-09-20 11:55:13

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

Re: aks_header : Compress your pages on the fly. Strip white spaces + gzip

Because adding domain specific compression (stripping unnecessary spacing) works better than using only generic compression (gzip), although the compression rate of gzip + space-stripping is not really a lot higher than just using gzip, which is clearly visible in the test that’s included in the topic start. When not using gzip, stripping spaces gives 8% compression, but if you are already using gzip, stripping spaces only compresses 1% more. It’s an interesting experiment, but not worth it in reality.

Offline

#14 2009-09-20 15:33:21

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355

Re: aks_header : Compress your pages on the fly. Strip white spaces + gzip

nik.martin wrote:

I think I found out what’s up: If Site Wide Comments are on (Admin > Preferences > Basic > Accept Comments), then an <h2 id=“comment”> is placed the bottom of EVERY article, regardless if comments are on for that article or whether “One By Default” is set to No, whic it is in my site. I think this is a bug in TXP, so I’m gonna check there. Otherwise, this totally breaks ANY use of aks_header for linking to normally external file in txp.

Set (Admin > Preferences > Basic > Automatically append comments to articles? – NO)

or

Temporary solution – edit Form “comments_display” and add some if tags.
For example <txp:if_comments_allowed><h2 id="comment">....</h2></txp:if_comments_allowed>

.

.

Possible it’s TxP bug or I understand TxP logic. :(

File /textpattern/publish.php, code from function doArticle

if ($use_comments and $comments_auto_append)
{
        $article .= parse_form('comments_display');
}

Possible this code need change to:

if ($use_comments and $comments_auto_append and $thisarticle['annotate'])
{
        $article .= parse_form('comments_display');
}

Last edited by makss (2009-09-20 15:36:57)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#15 2009-09-20 15:59:12

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

Re: aks_header : Compress your pages on the fly. Strip white spaces + gzip

I’d rather see the entire auto_append stuff removed from preferences. It’s the cause of a lot of confusion.

Offline

Board footer

Powered by FluxBB