Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-06-24 08:05:19

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,381
Website

serve pre-compressed content by default

It would be great if the htaccess came with the gzip compression script by default in the vanilla installs of txp.

This is what google suggests for Apache servers but I found that it did not work for me. Instead I used

<IfModule deflate_module>
AddOutputFilterByType  \
DEFLATE  \
application/javascript \
text/css \
text/html \
text/javascript \
text/plain \
application/rss+xml \
application/atom+xml \
text/xml
</IfModule>

Better solutions are of course welcome for the core.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

#2 2015-06-24 08:56:49

gaekwad
Admin
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 2,633

Re: serve pre-compressed content by default

+1

Offline

#3 2015-06-24 09:12:29

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,842
Website

Re: serve pre-compressed content by default

Are there any side-effects of this if the server doesn’t support it? Presumably the conditional never fires, so it’s all good. Is the absence of the deflate_module a reliable indicator of support, or are there other ways to offer compression (I’m thinking here if there might be differences between running things under FastCGI vs mod_php or under IIS and so forth)?

Last time I asked, my host bizarrely didn’t support compression “for performance reasons”. Mind you, if I go with rolling my own hosting, I’d switch it on.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#4 2015-06-24 09:28:11

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,759
Website

Re: serve pre-compressed content by default

IfModule is a conditional – if the feature is turned off nothing (bad) will happen. Note that deflate_module is Apache2 only. I need to check somewhere deep in my archives what the syntax I used for Apache 1.3.

Offline

#5 2015-06-24 12:36:54

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,381
Website

Re: serve pre-compressed content by default

phiw13 wrote #291937:

IfModule is a conditional – if the feature is turned off nothing (bad) will happen. Note that deflate_module is Apache2 only. I need to check somewhere deep in my archives what the syntax I used for Apache 1.3.

There is this (untested by me) for Apache 1.x and 2.x but mod_gzip needs to be installed.

Maybe we should do a forum survey to check the server specs of our users…


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

#6 2015-06-24 13:11:16

philwareham
Core designer
From: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 3,216
Website

Re: serve pre-compressed content by default

Surely that is not part of Textpattern’s remit? The .htaccess file we supply should contain Textpattern-specific stuff and nothing else. If someone wants to add to the .htaccess file with their own stuff then they can after install.

Also, not everyone uses Apache.

Also, I have my compression stuff in the Apache conf.d directory not in a .htaccess file.

Offline

#7 2015-06-24 13:23:50

gaekwad
Admin
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 2,633

Re: serve pre-compressed content by default

philwareham wrote #291954:

Also, not everyone uses Apache.

True. But Textpattern is only officially supported on Apache.

Offline

#8 2015-06-24 13:27:54

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,842
Website

Re: serve pre-compressed content by default

philwareham wrote #291954:

I have my compression stuff in the Apache conf.d directory not in a .htaccess file.

That’s why I was asking about other ways of running Txp under different environments. We put a stock .htaccess file for clean URLs and serving index.php. Anything above and beyond that is for the individual admin to determine and implement.

Having said that, some nice curated examples of this kind of thing wouldn’t go amiss, either in the official documentation, or as packaged “alternatives” (like we’ve done with htaccess-dist).

If such a place existed, I’d also include a boilerplate for using SecFilter to bypass problems due to host content filtering that trips 403s / 500s when trying to save admin pages. Maybe other examples too.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#9 2015-06-24 14:03:54

philwareham
Core designer
From: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 3,216
Website

Re: serve pre-compressed content by default

Bloke wrote #291958:

Having said that, some nice curated examples of this kind of thing wouldn’t go amiss, either in the official documentation, or as packaged “alternatives” (like we’ve done with htaccess-dist).

There are plenty of resources on GitHub for that sort of thing already, like here and here.

Offline

#10 2015-06-24 14:12:00

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,842
Website

Re: serve pre-compressed content by default

philwareham wrote #291963:

There are plenty of resources on GitHub for that sort of thing already

Good to know, thanks. They don’t address the SecFilter / mod_security things though. Having this kind of info in some useful format nearby might still be beneficial, given the number of times it crops up as a support request. Not sure if that’s feasible nor how to best go about it.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

Board footer

Powered by FluxBB