Answer the question
In order to leave comments, you need to log in
Images on the site are periodically not loaded, why?
Hello! From time to time, pictures on the site stop loading, while from different computers from the site everything is loaded in different ways - for someone everything is ok, for someone not. Such problems began to appear after the creation of the CNC on the site (well, or before they were simply not even noticed).
In network in a smoking browser:
In a normal browser:
However, this disappears over time. It happens that the page thinks from 5 to 25 seconds before loading, and sometimes everything is on the fly. What could be the cause of this pain?
Answer the question
In order to leave comments, you need to log in
Pending is waiting. If the smoker has Chrome - then he is limited to 6 simultaneous connections to one resource. You have established a connection, received a page and the browser starts loading the statics. And judging by the browser of the "non-smoker" - you have small pictures there, and you need to establish a connection for each file. With a limit of 6 connections, if you have something slowing down from above, the rest will smoke until the queue is freed.
I turn on the telepathic helmet ...
One of the options is to combine small pictures into sprites and load them in one connection, displaying the right sections in the right places using CSS. (Google PageSpeed will tell you the same)
The second, as a half measure, is to use the cache of the client's browsers so as not to load images from the server every time. But the first time you still have to load them from the page anyway.
Further, apparently, you either cut the speed of access to the web server, or the server frankly slows down. Loading an 80KB image in a second is a long time.
I would venture to suggest that you have Apache as your web server. In this case, I recommend moving it, for example, to 127.0.0.1:80, and in front of it, on the same server, plug nginx with a simple config on the external interface:
server {
listen 192.168.0.1:80;
server_name my-super-puper-project;
location ~ ^.+\.(jpg|png) {
root /home/www/your-project-name;
expires 1d;
}
location / {
proxy_pass http://127.0.0.1:80;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question