Go to main content

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: 9,090
Website GitHub Mastodon Twitter

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 | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

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

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,260
GitHub

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: 11,448
Website GitHub

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

Offline

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

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,194
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.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

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

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

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 | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

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

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

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
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,260
GitHub

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: 11,448
Website GitHub

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

Offline

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

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

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: 11,448
Website GitHub

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

Offline

#11 2015-06-24 14:19:57

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: serve pre-compressed content by default

Bloke wrote #291965:

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.

If you want to put together examples of .htaccess files then I suggest using Textpattern’s GitHub account. Just make a new project there.

Offline

#12 2015-06-24 14:30:35

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

Re: serve pre-compressed content by default

philwareham wrote #291966:

If you want to put together examples of .htaccess files

I’m hardly an authority!

If people want to suggest ones that work by jotting them here, maybe we can agree on a shortlist that represent snippets that’d benefit the community.

If it then makes sense to collect them into an official online resource, maybe GitHub is the right place for it. Dunno. Is it really versionable “source code” as such or are people using GitHub for this kind of thing because it’s a handily available central repo?


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

Offline

Board footer

Powered by FluxBB