So we have recently inherited a wordpress site and are moving it to platform.
When doing speed tests on it all testing sites report there is no text compression enabled.
The platform documentation seems to suggest that it is by default but all tests report css js etc is not being compressed. can anyone advise on this.
I’m not sure what you mean by “text compression.”
Requests for dynamic pages (generated by WP) will never be encrypted, because that’s a security risk.
Requests for static files should be compressed automatically, if the files are a compressable type (we skip image files, for example) and if they will be cached. If that’s not working, the usual culprit is that the cache settings in routes.yaml
are not caching anything, due to cookies. Check your cache-cookie list in routes.yaml
against the one in our template project:
https://github.com/platformsh-templates/wordpress-composer/blob/master/.platform/routes.yaml
Also make sure some cache lifetime is set for those files, either as a default in routes.yaml
or directly in .platform.app.yaml
.
You can also check the HTTP response headers for the file to make sure it’s being served from the cache. If it’s not cached, we don’t bother compressing it. 9/10 times something not compressing is because of a cache issue.
Thanks for the advice, also by default do you only compress items on the master branch?
I have made the above changes to my develop branch but not seeing any improvement so thought id see if that could be due to being on develop
The compression logic should be identical on all environments.
If you’ve already verified the cache, we’ll have to take a look at your config files specifically. I’d suggest filing a support ticket, and reference this thread. They can tell you if there’s any configuration option you may have missed.
Hello,
About the txt compression net settable for text.html content type.
The security issue is this one :
REACH (CVE-2013-3587) potentially NOT ok, “gzip” HTTP compression detected. - only supplied “/” tested Can be ignored for static pages or if no secrets in the page
I highlight : “Can be ignored for static pages or if no secrets in the page”
For an application, I am 100% ok with your point of view.
For a classic website which serve content aka wordpress, drupal, it should be allowed to configure the compression. (note: /user/ and wp-admin/ should be excluded and not compressed)
For example for platform.sh website :
curl -H “Accept-Encoding: gzip” -I https://platform.sh/
HTTP/2 200
content-type: text/html
cache-control: max-age=300
content-encoding: gzip
So ok for platform sh website and not for website customer hosted on platform sh.
Note : I am reading the documentation for half an hour and not getting how i can set the compression/gzip/brotli configuration. If we can do, please point us the right doc.
Regards,
I’m also looking for a way to enable compression on Drupal. My website has a large number of routes that are only accessed anonymously (there is no personalization of any kind), so I was hoping to be able to compress them, but I can’t find anything in the docs.
I did find the Gzip HTML Output module, but this module comes with some important gotchas and I would rather handle the compression on the server if possible.