The .htaccess file shipped by Drupal already enabled gziping of pages if the client supports it.

As per the thread in the performance group, for most use cases it is more performant to remove this variable and associated behaviour. Apache is optimised to handle the compression transparently depending on the client. Although this will result in larger amounts of data being stored in the page cache, there isn't the overhead of compression (and in some cases uncompressing) the cached pages.

Comments

skwashd’s picture

Title: Remove page_compression » Remove $page_compression and associated behaviour
Status: Active » Needs review
StatusFileSize
new14.27 KB

And here is the patch for it.

dalin’s picture

Sure doing it at the Apache level is more performant. But what about sites that don't have access to that (i.e. shared hosting). Will this patch not decrease performance for those sites?

damien tournoud’s picture

It should be more efficient to handle that in Drupal. More clients those days support compression, so it's better to store the compressed data directly in the cache and serve it transparently. On-the-fly compression at the Apache level doesn't seem like a good idea.

damien tournoud’s picture

The .htaccess file shipped by Drupal already enabled gziping of pages if the client supports it.

That's not actually true, as far as I know.

thedavidmeister’s picture

Status: Needs review » Needs work

The last submitted patch, drupal-1321918-remove-page-compression.patch, failed testing.

damien tournoud’s picture

Status: Needs work » Closed (won't fix)

The same thread has since proven that this is not a good idea.