opencodeiiita / Opencode-Collaborative-19

Collaborative website for OpenCode-2019
https://opencodeiiita.github.io/Opencode-Collaborative-19/
MIT License
35 stars 190 forks source link

Prefetch participant images fixes #311 #351

Open anupm12 opened 5 years ago

anupm12 commented 5 years ago

Did you read the instructions in README ?

Yes

Solves which issue ?

Fixes #311

Give discription.

Images are now being cached by the browser and the loading is comparatively faster now. All time it takes is to fetch data from json. I have made a script to fetch the images and prefetched that script using HTML.

Checklist

(To mark the checkboxes use x within the box brackets)

anupm12 commented 5 years ago

@Anupam-dagar @ananya-agrawal please review this pr.

anupm12 commented 5 years ago

I'm not sure, but I think it works better in Firefox developer edition.

prateek76 commented 5 years ago

link

anupm12 commented 5 years ago

I'm sorry. I forget everytime 😅 live link https://preloadimages.netlify.com/

prateek76 commented 5 years ago

@anupm12 i can't see any impovement also in firefox it's taking more time than before

anupm12 commented 5 years ago

@prateek76 Let me check it

anupm12 commented 5 years ago

@pradeepgangwar @ananya-agrawal @prateek76 I have made use of prefetch HTML attribute and I read on StackOverflow that this attribute is not widely supported by browsers. Can you suggest me some alternative method to prefetch images folder or the participant.json file?

https://stackoverflow.com/questions/41655955/why-are-preload-link-not-working-for-json-requests

anupm12 commented 5 years ago

This is my code image

This is what it does image

I don't know if this is preloading or not.

Anupam-dagar commented 5 years ago

@pradeepgangwar take a look at it.

pradeepgangwar commented 5 years ago

This is not the correct way to load image and assign. I see that in your script you are appending it in body tag. I will get back to this today evening.

anupm12 commented 5 years ago

Ok @pradeepgangwar

pradeepgangwar commented 5 years ago

@anupm12 Sorry for delay 😅 . I got busy with other things and completely forgot about this one. Let me check this.