Images and avatars of MAX channels on datool.ru now they go through CDN
Avatars of channels, pictures of posts and categories on datool.ru distributes the content delivery network (CDN) from the address media.datool.ru : WebP files, small avatars for lists, lazy loading — pages open faster.
All the pictures of the showcase datool.ru — avatars of MAX channels, images from posts, category covers, screenshots of documentation — are now distributed via CDN, a content delivery network. The browser receives the file from address media.datool.ru from the nearest network node, and not directly from the repository. At the same time, we converted all copies to WebP format, made small avatars for the lists, and set up lazy loading of images below the screen.
Why it's needed: the catalog page, rating or "Today in MAX" shows dozens of channels at once, and each with its own avatar. Previously, it was the pictures that were the hardest part of such pages. Now they are smaller in weight, they reach the browser faster and do not slow down the display of text and numbers for which you opened the page.
What is a CDN and why do we use it
CDN (Content Delivery Network) is a network of servers that store copies of files and give them to visitors. When you open the channel page, the avatar does not come from the main repository, but from the CDN node, where it is already in the cache. The repository does not need to respond to every request, and the visitor receives the image faster.
This is important for us for three reasons:
- Speed. The CDN node gives the file from the cache, without going to the repository; re-opening the page takes pictures from the browser cache as well.
- Stability. Peak load — for example, when many people open a popular channel at the same time — falls on the delivery network, not on storage.
- The order of addresses. All images of the service live at the same address
media.datool.ru, and the API also gives it away: the avatar field in the channel card leads to our copy via CDN.
The original copies are stored in Russia, in object storage, and the site runs on servers in Moscow.
Which images go through CDN
- Avatars of channels and bots MAX. We make a copy of the avatar as soon as we read the channel card, and we keep it constantly. If the owner has changed the avatar in MAX, the old copy is deleted and a new one appears.
- Pictures of posts. For posts younger than 7 days, the preview is prepared immediately after collection. For older posts, a copy is made at the moment when the picture is first opened by a person — from the next show it is already ours.
- Category images. Images of categories in the category catalog and on category pages are stored in two sizes — up to 800 and up to 500 pixels.
- Screenshots of documentation and blog covers. Illustrations on docs.datool.ru they also lie in storage and are distributed via CDN.

WebP and reasonable sizes
Each copy is saved in WebP format — it gives a noticeably smaller file than JPEG or PNG, with the same view on the screen. The sizes are matched to the way the picture is shown:
- preview of the post image — up to 800 pixels on the long side;
- channel avatar — up to 320 pixels for the channel header and post page;
- a small copy of the avatar — up to 96 pixels for lists;
- images of categories — up to 800 and up to 500 pixels while maintaining the proportions.
The smaller image does not stretch at the same time: if the source code is MAX less than the limit, the copy remains its size.
Small avatars for lists
In the catalog, ratings, on the pages "MAX Statistics" and "Today in MAX", the avatar is a circle of 26-48 dots in size. Showing a 320-pixel copy for him was wasteful. Therefore, from each downloaded image we make another, small copy — up to 96 pixels, this is a clear circle even on a double-density screen.
The weight of such a copy is 1-2 KB instead of 3-30 KB. On the "Today in MAX" page, avatars used to weigh about 0.75 MB, now about 10 times less. The channel header and the post page still show a large avatar - it's really needed there.
Lazy loading: first what's on the screen
The pictures that are visible immediately when the page is opened are loaded first: the winners of the "Leaders of the Day", the first ten cards of the channel catalog and rating lines. Everything below the screen or on hidden tabs, the browser loads as it scrolls. This way, the first part of the page appears faster, and images that you haven't scrolled to don't waste traffic.
If the avatar didn't load the first time, the site will request it again; if the replay fails, there will be an even circle instead of the broken image icon.
What we don't copy
- Images of closed channels. We never put them in public storage — on the page of a closed channel that its owner sees, the images are shown with the MAX link.
- Video, audio and files. The video is played directly from the MAX servers, we only have a preview frame stored.
- Deleted posts. If the post is deleted in MAX, we erase it from the database along with copies of the images.
Who is it useful for
- Storefronts — pages with long lists of channels open faster to visitors, especially on the phone and mobile Internet.
- Channel owners — Channel avatars and images on datool.ru they look neat and do not disappear when the temporary MAX link stops working.
- For developers — in the API, the avatar field leads to a permanent copy via CDN, you can safely show it in your interfaces.
Frequent questions
Do I need to configure something so that the pictures go through the CDN?
No, it's not. Everything works by itself: the site gives links to media.datool.ru, the browser receives files from the nodes of the delivery network. You don't need to enable or install anything.
Why does the old post sometimes have a picture that doesn't appear right away?
Copies of images of posts older than 7 days are made at the first display. While there is no copy, the site shows the original image from MAX or the "Upload image..." stub and will substitute the copy itself when it is ready.
Why does the channel have a different avatar than in MAX?
The copy is updated when we read the channel card again. If the owner has just changed the avatar, a new picture will appear after the next update of the card, and the browser may still show the old one from its cache for some time.
Is it visible through CDN pictures of closed channels?
No, it's not. We do not copy images of closed channels to the repository and do not distribute them via CDN.
The result
According to datool.ru There are hundreds of thousands of MAX channels open on the showcase, and almost everyone has an avatar. Now all these pictures come through the content delivery network, in WebP and in the size that is needed on the screen. Open the channel catalog or channel page and evaluate the speed yourself. About how the service started - in the launch news datool.ru .




