重新呈现从缓存SVGs。重新计算或记住了吗? [英] Re-rendering SVGs from the cache. Recomputed or remembered?

查看:451
本文介绍了重新呈现从缓存SVGs。重新计算或记住了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法找到这个问题的答案,当浏览器需要一个SVG从缓存它重新计算XML与否,它存储图像,它已经产生的? (如何?)

I can't find an answer to this question, when the browser takes an SVG from the cache does it re-compute the xml or not, does it store the 'IMAGE' that it has already created? (How?)

我就已经想到没有,但后来我发现如何快速重复svgs负荷。

I would've have thought not, but then I've noticed how fast repeated svgs load.

我也注意到在页面标志缓慢(在移动浏览器),这让我觉得他们重新计算SVG,所以我搬到PNG的(这显然是缓存),移动节省了大量的计算对于低端手机。

I've also noticed slowness on a page logo (in mobile browsers) which make me think THEY re-compute the SVG, so i've moved to PNG's (which are obviously cached) for mobile to save a lot of computational work for the low end phones.

所以,也许,做答案依赖于浏览器/浏览器类型/浏览器设置?

So maybe, does the answer depend on the browser / browser type / browser settings?

*我的SVG的是COM pressed SVGZ的的方式

*my svg's are compressed svgz's by the way

推荐答案

有时它,有时没有。大多数浏览器去一些努力不是重新呈现的东西,除非他们不得不这样做。有一个缓冲的渲染中SVG 1.2微型财产这可能会帮助,如果你正在使用Opera,其他浏览器尝试,无需这样的提示,虽然自动做的事情。

Sometimes it does and sometimes it doesn't. Most browsers go to some effort not to rerender things unless they have to. There is a buffered-rendering property in SVG 1.2 Tiny that may help if you're using Opera, other browsers try to do things automatically without requiring such hints though.

浏览器一般不用缓存SVG内容作为一个简单的位图虽然。他们这样做缓存之类的东西绝对位置和形状大小和文字与转换应用,CSS的树形结构,渐变等,然后更快地使用这些信息,他们可以重绘内容不必做出来的每个重绘。这些信息可以让浏览器与SVG部分内容的JavaScript和SMIL动画以及复制为用户滚动。

Browsers generally don't cache SVG content as a simple bitmap though. They do cache things like the absolute position and size of shapes and text with transforms applied, the css tree structure, gradients etc and then use this information they can redraw the content much more quickly than having to work it out each repaint. Such information allows browsers to copy with javascript and SMIL animation of parts of the SVG content as well as user scrolling.

这篇关于重新呈现从缓存SVGs。重新计算或记住了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆