2

I have some large, dynamically generated SVGs that are being served over a relatively slow internet connection. I'm trying to optimize them to be viewable as fast as possible. If I set the server to Content-Encoding: gzip and Transfer-Encoding: chunked, will any SVG viewers take advantage of that and render it partially, as it is transferred? If not, are there other ways to get it to render as-it-streams? I could break it up into several SVG pieces but that will be a lot of work, I was hoping for server settings...

The most common users use IE7 with the Adobe SVG Viewer plugin.

I doubt it matters but I'm serving with C#/ASP.NET and IIS6.

Scott Stafford
  • 43,764
  • 28
  • 129
  • 177

2 Answers2

1

SVG is streamable (as well as gzipped chunked encoding), so theoretically it is possible to display only partially downloaded file.

I don't know if IE+SVG actually does it. Test it! Do something equivalent of:

echo('<rect…>'); 
flush(); 
sleep(10);
echo('<rect…>');

and see if it works.

Kornel
  • 97,764
  • 37
  • 219
  • 309
0

It seems that at least in Chrome and Firefox SVG does render partially while being displayed directly or inside an <iframe>, but in an <img> it is not rendered until fully loaded.

grandrew
  • 698
  • 7
  • 12