Google Chrome loads image from cache slower than loading

I am creating a web application to view large photos on a local server.

The strange thing is that the Chrome download form cache loads too much time, even much more than downloading from the local server.

Each photo is about 5 MB, Chome allows you to download it about 200 ms, but it costs about 400 ms from the cache.

Below is a screenshot: enter image description here

My environment is Mac OSX 10.8.4, and I tested it on a PC - it cost about 700 ms.

Here is the jsfiddle test.

I cannot find images of this size on the Internet, so you may need fiddle2 or Charies to map these images to your local images. And rewrite the title to make Chrome cache them:

Expires:Wed, 17 Jul 2013 01:50:08 GMT Cache-Control:max-age=604800 Connection:keep-alive Date:Wed, 10 Jul 2013 07:33:51 GMT Last-Modified:Wed, 10 Jul 2013 01:13:26 GMT 
+4
source share
1 answer

Not very useful, but my solution to this problem was to encode images as data URIs. Duplicating images (as I did) or pulling from the cache is about 10-50 m.

If you upload images via AJAX, you will have to keep track of CORS issues, but if you upload them to the server side, you just need to find out if you can embed them without making your page loading takes too much time.

0
source

Source: https://habr.com/ru/post/1490709/


All Articles