Active
Project:
Lost & found issues
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
21 May 2012 at 05:21 UTC
Updated:
20 Jan 2013 at 22:13 UTC
Jump to comment: Most recent
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
Comment #1
sreynen commentedI 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.
Comment #2
mikeytown2 commentedThis 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 :)
Comment #3
sreynen commentedMy 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.
Comment #4
eleonelI want to colaborate with that, i can create this module ;)
Comment #5
sreynen commentedeleonel, great! Let me know if you need my help with anything.
Comment #6
eleonelok, thanks!
Comment #7
mikeytown2 commentedMoving this issue to the sandbox
http://drupal.org/sandbox/eleonel/1597852
Comment #8
chrishrtmn commentedAny 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.