Close

Sprites

IvanSlater
9 years ago
#8231 Quote
Avatar
  • 89
Hi there.

As you know, product ribbons do a lot of extra requests to get the ribbon images.
It makes one request for each ribbon from each product, that is a lot of requests.

So, should be nice use sprites or less request.

It makes site slowers and increase server usage.

Can you take a look?
Boyko
9 years ago
#8249 Quote
Avatar
  • Moderator
  • 1570
IvanSlater wrote:
Hi there.

As you know, product ribbons do a lot of extra requests to get the ribbon images.
It makes one request for each ribbon from each product, that is a lot of requests.

So, should be nice use sprites or less request.

It makes site slowers and increase server usage.

Can you take a look?


Hi IvanSlater,

The ribbons don't make so many requests as you described. The number of requests is equal to the number of different ribbons if each ribbon uses a different picture. A ribbon can be shown for many products but as the image of the ribbon is the same for all these products then the browser will make only a single request to get this image from the server and then it will use the same downloaded (cached) image (no more trips to the server).
So if you have 5 different ribbons (5 different pictures) on a single page then only 5 requests will be made from the browser.
You can use sprites now if you want and have these 5 images into a single sprite image.
But then you have to define styles for each ribbon and instead of uploading an image from the administration you will have to define the sprite image as background image of the ribbon.
Regards,
Nop-Templates.com Team
IvanSlater
9 years ago
#8252 Quote
Avatar
  • 89
Hi Boyko.

Thanks for the answer. In our case, we use CDN to load images, so, each ribbon comes from a differente cdn server, what is creating multiple requests.

You can enable CDN and see it happens by webpagetest.org.

Thanks!!
Boyko
9 years ago
#8269 Quote
Avatar
  • Moderator
  • 1570
IvanSlater wrote:
Hi Boyko.

Thanks for the answer. In our case, we use CDN to load images, so, each ribbon comes from a differente cdn server, what is creating multiple requests.

You can enable CDN and see it happens by webpagetest.org.

Thanks!!


Hi IvanSlater,

Yes, that makes sense. In that case you can use the approach with the css styles of the ribbon and use sprite background image.
Regards,
Nop-Templates.com Team