Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

extend_cache_images should add caching headers to SVG images #1221

Open
designgrill opened this issue Dec 16, 2015 · 8 comments
Open

extend_cache_images should add caching headers to SVG images #1221

designgrill opened this issue Dec 16, 2015 · 8 comments

Comments

@designgrill
Copy link

A large number of file formats can benefit from addition of caching headers (which also involves URL rewriting) even if the content is not optimized.

With extend_cache_images filter, SVGs are ignored as they are instead considered XML type. Given SVG is becoming a more mainstream thing, it should at least have better caching headers if not optimized content.

@jeffkaufman
Copy link
Contributor

Another option here would be to treat svgs as standard images, making them eligible for optimization as well as cache extension.

@huibaolin are there things we could be doing to optimize svgs? I know they're vector graphics in xml, but there are probably some redundant things we could clean up?

@designgrill
Copy link
Author

@jeffkaufman There is https://github.com/svg/svgo which works beautifully but is node based. To try it out quickly, you can also look at its frontend https://jakearchibald.github.io/svgomg/

@jeffkaufman
Copy link
Contributor

Moved optimizing svgs to a new bug: #1231

@jeffkaufman
Copy link
Contributor

Moved converting png to svg to a new bug: #1232

@oschaaf
Copy link
Member

oschaaf commented Dec 18, 2015

Would it make sense to look at cache extending for more mime types at this point? E.g. Webfonts? Tiff images? Mp3 audio? Is the work to be done on this dependent on the mime-type of the response?

@designgrill
Copy link
Author

What @oschaaf is suggesting makes lots of sense. This issue is not svg specific. As of now only certain images, css, js, and pdfs get extended cache support. Content optimization and cache extension (along with url rewrite) can be fairly independent.

May be we can have a filter which accepts the list of extensions to be cache extended.

@lawrencedudley
Copy link

+1 - this would be useful!

@bbhagan
Copy link

bbhagan commented Sep 20, 2018

My client uses mps on all of their properties and relies on it heavily. SVG cache extension would really help them get to where they want to be on webpagetest:

https://www.webpagetest.org/result/180920_7N_09b9065cab717e534a923e87cb8b00e3/1/details/#waterfall_view_step1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants