Open simonjvardy opened 3 years ago
Site tested with lighthouse with a filtered view showing far less products than the "All Products" page and the performance is good.
The poor performance is related to the total number of media assets the various filtered views must load. The total number of products on the site needs to be re-assessed and trimmed down significantly to improve the overall site performance and useability.
Django Paginator class tested (Django Pagination Documentation) with each page limited to 40 results per page and this worked successfully.
However, the products filtering was inadvertently disabled and couldn't find a way to incorporate both filtered views and pagination in the time available.
Tried converting all image files from .jpg to .webp format to reduct the network payload by 50%.
However, to incorporate the webp version into the templates and maintain browser support, the <img>
tags would need to be replaced with:
<picture>
<source srcset="{{ product.image.url }}" type="image/webp">
<source srcset="{{ product.image.url }}" type="image/jpeg">
<img src=="{{ product.image.url }}" alt="{{ product.name }}"
</picture>
However, this wouldn't work as there would need to be a 2nd image url field on the products model to serve the webp image which would cause too much work at this late stage of the project.
The current solution to this problem is to reduce the number of products from 370 down to 193 to improve the loading performance of the "All Products" page.
The best solution is still to add in pagination.
Describe the bug Deployed Heroku site very poor Google Lighthouse performance
To Reproduce Steps to reproduce the behavior:
Expected behavior The site pages should load quickly without too much load fetching the media files
Screenshots![image](https://user-images.githubusercontent.com/65361514/119280038-52925400-bc27-11eb-9d0f-e994f0b4db82.png)
Desktop (please complete the following information):