lemanschik / awesome

A Magic Repository Started By a Magic Number enables git tree submodule branch flows.
1 stars 2 forks source link

(docs) Caching Guide #3

Open lemanschik opened 1 year ago

lemanschik commented 1 year ago

Caching guide

@cccider yes it does support that via so called http headers on request google for so called fetch range but out of caching view i would suggest you to never use sprites fetch directly the image with the offered get parameters from the cdn that gives you best cache reuse results it is not clever to put many images into one and use them as sprites i can tell you that i am engine author was even working back in the days on optimizing quake so i know the old guys from ID Software directly and i am now working on Chromium and the v8 engine when i tell you that sprites are not useful today you can fully trust my authority into that when the creator tells you that sprites are bad then that is the ultimate claim that you should accept no matter how clever you think your idea is. If you like to construct clever caching implementations try out serviceWorkers they are a forwardProxy Implementation for the browser so they are able to intercept requests even to 3th party and cache them and also replace results if you like to serve a large amount of images for example serve a tar.gz get it via the serviceWorker use the install hook and preCache first and then you cache them under the same cdn urls as edge cdn offers them this way you get fully interop for your offline apps your service worker can single fetch and for your online apps it only loads what gets into the scope i will write a caching guide i guess on the web it is more clever to only cache on demand while it is for offline apps essential can speed up install time if you prefetch tar.gz as you know you will need it all on web a human can not display mutch on its screen so it makes not sense to transfer so much until it is needed