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 matt开发者_Python百科ers but I'm serving with C#/ASP.NET and IIS6.
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.
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.
精彩评论