pythonindia / inpycon2018

PyCon India 2018 site
https://in.pycon.org/2018/
Other
110 stars 61 forks source link

compressed sponsors images - tinified #177

Closed bhansa closed 6 years ago

bhansa commented 6 years ago

Partly solves #163

bhansa commented 6 years ago

compression report for timeline images: image

ananyo2012 commented 6 years ago

Yeah you can remove the unwanted images. But don't think it would create much of a difference in site load anyway since only included images are the one that affect the site load performance isn't it ?

bhansa commented 6 years ago

If we are not including them on the page, then it's fine to keep them the same way or we can just move them to a different folder altogether. One more thing can we have a different image for Sidu ponnappa, the current one is not clear.

bhansa commented 6 years ago

Added the service worker code to cache js/css/json files, please review and suggest. Also if there is any other better approach please let me know.

ananyo2012 commented 6 years ago

@bhansa Is there any way to measure how much the speed improved due to caching ? Also do the cache-polyfill.js ans service-worker.js needs to be kept outside the js folder ?

bhansa commented 6 years ago

service worker has to be in the root folder, so that's fine. We can check the speed using lighthouse extension.

realslimshanky commented 6 years ago

@bhansa please go through this doc which can help you understand how to provide proper versioning to the service worker.

ananyo2012 commented 6 years ago

Sorry for the delayed response. This looks good to go. Here are the stats. There is a significant improve in performance

Before before-optimization

After after-optimaztion

ananyo2012 commented 6 years ago

@bhansa Can you keep the changes of compressing images and the caching in 2 separate PRs. The first change is good to go. But we need to think a bit more about the caching stuff.

I observed that caching may cause the website to not reflect changes that we pushed recently and often we need to do a hard reload which we usually forget. So we need to expire the cached data after a time interval so that it tracks changes when we push them.

bhansa commented 6 years ago

@ananyo2012 I have reset this branch, please check and merge.

ananyo2012 commented 6 years ago

Thanks @bhansa . Merging this. Do make another PR for caching part. We can continue discussion there.