Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2 created an issue. See original summary.

mikeytown2’s picture

Status: Active » Needs review

First step; this should create .br files if the brotli_compress function exists. Will also use https://github.com/kjdev/php-ext-zopfli if it exists instead of gzencode.

Need to test for .br on the status report page.

mikeytown2’s picture

ponies’s picture

After installing the php extension I applied this patch to 7.x-2.18+34 and the assets were generated as expected. However I'm still muddling through convincing apache to serve them.

Would adding brotli support to .htaccess be a Core feature request? Is that the best way to go about it or is there a more appropriate apache configuration change? Is there any value in having zopfli with brotli?

mikeytown2’s picture

  • mikeytown2 committed 747dfaf on 7.x-2.x
    Issue #2773807 by mikeytown2: Add in support for brotli compression
    
mikeytown2’s picture

Status: Needs review » Active

#3 has been committed with some minor changes to the admin section. Keeping open as apache support and status report page testing needs to be added.

  • mikeytown2 committed 51b85a5 on 7.x-2.x
    Issue #2773807 by mikeytown2: Add in support for brotli compression
    
mikeytown2’s picture

htaccess has been committed. All that's needed is the status report check.

mikeytown2’s picture

Status: Active » Needs work
FileSize
10.47 KB

Coming back to this on Monday.

  • mikeytown2 committed f78a069 on 7.x-2.x
    Issue #2773807 by mikeytown2: Add in support for brotli compression
    
mikeytown2’s picture

Status: Needs work » Active
FileSize
17.33 KB

This has been committed. Need to update .htaccess files

  • mikeytown2 committed 5b3083c on 7.x-2.x
    Issue #2773807 by mikeytown2: Add in support for brotli compression
    
mikeytown2’s picture

Status: Active » Fixed

  • mikeytown2 committed 9aabe5b on 7.x-2.x
    Issue #2773807 by mikeytown2: Add in support for brotli compression
    

  • mikeytown2 committed 55c9539 on 7.x-2.x
    Issue #2773807 by mikeytown2: Add in support for brotli compression
    

  • mikeytown2 committed e692488 on 7.x-2.x
    Issue #2773807 by mikeytown2: Add in support for brotli compression
    
ponies’s picture

What do you think about the prospect of Drupal with a brotli+sdch?

mikeytown2’s picture

Doesn't seem ready for mass users quite yet
semi NSFW link: https://mikandi.com/blog/tips-and-tricks/press-me-a-sdch-implementing-sh...
https://engineering.linkedin.com/shared-dictionary-compression-http-link...

https://github.com/mikandi/sdch-tools seems like the closest thing to a drop in; so advagg can easily be used to generate a css/js dictionary but doing stuff on the apache/nginx side seems to be not easy at the moment. Although looking at the specs it seems like for static assets it'd be pretty easy to have it pre-compressed so a *.css.sdch.{Dictionary-Checksum}.gz or *.css.sdch.{Dictionary-Checksum}.br file; clearing all of those out when the dictionary changes.

also see: https://github.com/baranov1ch/node-sdch

I'm 100% open to patches; I have a lot of other things to take care of so I won't be the one writing sdch integration. I'd make it a sub module; similar to the sri module

ponies’s picture

When I initially set this up everything went well, but a couple days later I noticed that the site was serving gziped resources again. There were no .br files in advagg_css, or advagg_js. Clearing the AdvAgg cache didn't bring them back, but resorting to drastic measures regenerated them. Once the .br assets were in place they were served. This has happened twice so far. Once since updating to AdvAgg 7.x-2.18+56-dev, and HTTPRL 7.x-1.14+51-dev.

mikeytown2’s picture

Status: Fixed » Active

So .br files are not getting created. Looks like I have the same issue.

mikeytown2’s picture

Just checked and this code fix (in advagg.advagg.inc) might have fixed the issue; not 100% sure as I'll have to wait and see. I'm getting .br files after clearing all files.

mikeytown2’s picture

Still more fixes are needed in advagg.missing.inc but this is a good start.

  • mikeytown2 committed c355c8e on 7.x-2.x
    Issue #2773807 by mikeytown2: brotli compression followup fixes.
    
mikeytown2’s picture

Status: Needs review » Fixed

Committed #23 with some additions to it.

  • mikeytown2 committed 744543a on 7.x-2.x
    Issue #2773807 by mikeytown2: brotli compression followup fixes.
    
mikeytown2’s picture

Found a couple more differences.

  • mikeytown2 committed 1e16eba on 7.x-2.x
    Issue #2773807 by mikeytown2: Fix php notice.
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

mikeytown2’s picture