Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
Re: serve pre-compressed content by default
+1
Offline
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
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
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 thatdeflate_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
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
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
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
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
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
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
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