To speed up the loading of a site by a font-loading HTTP request(s), is there any way you can add in compressing with Gzip of the fonts uploaded to "/default/files/local_fonts/[font-name]/[font-files]"?

Gzipping these font files (according to YSlow), reduces the sizes by ~70%. Although, one font format, WOFF, doesn't need to be compressed as it's built in already and may not work if Gzipped.

Here is an article further explaining in detail on compressing @font-face: http://www.phpied.com/gzip-your-font-face-files

Comments

sreynen’s picture

Project: @font-your-face » Advanced CSS/JS Aggregation
Version: 7.x-2.2 » 6.x-1.x-dev
Component: Code (general) » Code

I think this is a good idea, but it seems like a better fit for a module like advagg, which already does gzipping of CSS and JS files. Doing it in @font-your-face would, I think, result in a lot of duplicate code.

mikeytown2’s picture

Project: Advanced CSS/JS Aggregation » @font-your-face
Version: 6.x-1.x-dev » 7.x-2.x-dev
Component: Code » Code (general)

This could be a sub-module of AdvAgg, but after doing some quick reading, my guess is it doesn't belong in AdvAgg. Reason being AdvAgg deals with CSS & JS files; fonts are referenced by CSS but not directly embedded in the CSS. Having a CDN option for @font-your-face would belong as an AdvAgg submodule but sites/all/default/files/local_fonts/[font-name]/[font-files] is "owned" by @font-your-face, thus Gzip should be done by that module. I'm open to arguments for why it belongs in AdvAgg, but code duplication is not one of them as the code to gzip is pretty easy.
http://drupalcode.org/project/advagg.git/blob/be5146621462d51cabc166158a...

I can help with the .htaccess rules to get this working if needed :)

sreynen’s picture

Issue tags: +Novice

My argument is entirely code duplication. Even easy duplicate code is inefficient, as future changes need to be synced. That said, I'm not interested in pushing this onto a maintainer who doesn't want to it.

I would suggest anyone working on patches for this approach it as a separate module, if not a separate project, so we can more easily maintain it independently. If we need any additional hooks in @font-your-face, I'm happy to add them.

This could be a good first project for someone interested in getting into module development, since most of the code is already there and just needs to be repurposed.

eleonel’s picture

I want to colaborate with that, i can create this module ;)

sreynen’s picture

eleonel, great! Let me know if you need my help with anything.

eleonel’s picture

ok, thanks!

mikeytown2’s picture

Project: @font-your-face »
Version: 7.x-2.x-dev »
Component: Code (general) » Code
Category: feature » task
Issue tags: -Novice

Moving this issue to the sandbox
http://drupal.org/sandbox/eleonel/1597852

chrishrtmn’s picture

Any updates on this? I notice eleonel has a Sandbox of this, but no commits since May 2012 (and no module code at all). I'd do this myself, but I have yet to learn module development.

Project: » Lost & found issues

This issue’s project has disappeared. Most likely, it was a sandbox project, which can be deleted by its maintainer. See the Lost & found issues project page for more details. (The missing project ID was 1597852)