Hi All
I am building a site that has a piece of functionality that is pulling images from the Instagram API and they are being flagged up as the main issue in pagespeed insights.
The site is here:
http://demo.emmawedgwoodaesthetics.co.uk/
and the problematic page speed is here
If I hover on one of the images in devtools it shows me this:
Okay so my understanding is that the files size is too big and I need to serve a smaller file. Facebooks/Instagram Documentation is super bad and I cant find a way there to ask for a smaller image.
My template has this:
<div class="carousel ml-10p" x-ref="carousel">
{% for post in instafeed%}
<div class="w-3/5 h-10v pr-5 "><img class="rounded-3xl shadow-xl w-40 h-40 " src="{{ post.media_url}}" alt=""></div>
{% endfor %}
</div>
The w-40 h-40 are what is rendering the 160x160.
So how do I solve this problem?
I am thinking I need to use an image processing third party package? Do I need to?
I am thinking the minimum requirement is take a set of image_urls from instagram(1440 x 1440) convert them to smaller images on the server and then serve those in the view.
I have been looking at sorl-thumbnail, django-imagekit and easy-thumbnails and they all look neck and neck. What would people recommend if I went down this route?
I am also using wagtail in this project and they have and image tag that may be useful but only seems to apply to images in a page model. I haven’t ruled out a solution there.
Is there something that I don’t know about that could help me solve my problem?
Thanks
Chris

