有关在会话期间将图像预加载到客户端计算机的问题.
您好,感谢这个网站,它朝着正确的方向有所帮助,我非常乐于助人.我设法建立了一个功能齐全的网站,其中包含我所有的图形,嵌入的视频,图片库和javascript随机主题功能.
现在,我已经掌握了各个方面的基本功能和脚本,现在我想在CSS中重新设计它,以便不仅可以模板化我的网站,还可以使浏览器和分辨率之间的长宽比保持一致. >
TL:DR版本-是否有一个脚本可让我为用户创建会话变量,并且在该变量处于活动状态时,它将把我想在整个网站上显示的图像和背景下载到缓存中? br/>
IE.有人在主页上;现在,我的随机主题包含大约9个不同的图像,每个图像大约300kb.从9个随机数中选出3个,并放入3个独立的< div>''s,两侧向下2个,顶部1个.
通过允许将图像的背景"下载到缓存中,它可以使随机背景功能在完成导航首页后立即接近足够的瞬时值.
有想法吗?
Hello, thanks to this site and it''s helpful nods in the right direction, I''m plodding along quite nicely. I managed to make a functional website with all my graphics, my imbedded videos, an image gallery, and a javascript random theme function.
Now that I''ve got the basic functionality and scripts in place for various aspects, I now want to redesign this in CSS so I can not only template my site, but also to keep aspect ratios consistent between browsers and resolutions.
TL:DR version - is there a script that will allow me to create a session variable for a user, and while that variable is active, it''ll download the images and backgrounds i want to display across the site into the cache?
ie. someone is on the home page; now, my random theme consists of about 9 different images, of approximately 300kb each. from the 9, 3 random ones are chosen and placed into 3 seperate < div >''s, 2 down the sides and 1 at the top.
By allowing a ''background'' download of the images into the cache it''d allow the random background feature to be near enough instantaneous once they''ve finished navigating the home page...
Thoughts?
Cheers guys!
这个问题似乎被问了很多.让我先了解您.您要问的是您想要在没有用户操作的情况下将图像下载到客户端计算机中.对?当然,您说的是缓存,我将其理解为他们的浏览器缓存.
简单的答案是不,您不能做到.可以下载它的唯一方法是,如果您的页面引用了该图像.让我们在讨论此问题的同时在日落时分在湖边散步,稍等片刻,我知道您打算提高应用程序的性能,但是如果可能的话,客户将能够如何阻止他的机器被某些恶意人员倾倒,您知道我的意思是,将它们倒入他们的缓存吗?
This question seems to be asked a lot. Let me try to understand you first. What you asking is that you want to download images into the client machine without the user action. Right? Of course you said cache, which I understood as their browser cache.
Simple answer is no you can not do it. The only way you can have it downloaded is if you page references the image. Let us take a nice walk by the side of the lake at sun set while discussion this issue, wait a minute, I know you intended to increase the performance of your application, but if that is possible, how would be the client able to to prevent his machine from some malicious person dumping all kinds of, you know what I mean, into their cache?