Browser Caching Best Practices, When to use no-cache vs max-age without breaking your site

  Рет қаралды 25,817

Hussein Nasser

Hussein Nasser

Күн бұрын

Пікірлер: 46
@Fireship
@Fireship 3 жыл бұрын
Nice video! Jake Archibald is always an excellent resource
@bhumit070
@bhumit070 3 жыл бұрын
Hey jeff good to see here :)
@patcodingcodester9781
@patcodingcodester9781 3 жыл бұрын
Yall two have the most useful channels out here. Thank you both
@mahdikarimi6467
@mahdikarimi6467 3 жыл бұрын
I watch every second of your work with unlimited amount of passion and joy! keep it up
@mohammedsalman3397
@mohammedsalman3397 3 жыл бұрын
i just love my life when i see a video of yours in my feed
@tonynguyen4007
@tonynguyen4007 3 жыл бұрын
Hey Hussein, we are connected somehow. I have been checking on Cache-content this morning and your video came up, so I liked it before watching. Thank you and Jake for great content.
@sircosm
@sircosm 3 жыл бұрын
I was looking up cache-control stuff this morning and BOOOOOM up comes your new video! Thanks so much for the excellent content!
@smoothbeak
@smoothbeak 3 жыл бұрын
Wow, this is really great. First of all great content from Jake Archibald, and then the further explanations by Hussein, that is an excellent combo, and I can say I feel rather educated on caching now, and before the video I didn't know a damned thing!
@hashiromer7668
@hashiromer7668 3 жыл бұрын
I am watching so much of your videos that I saw you in my dream tonight 😂. It was pretty detailed but the only thing i remember now is that it was about some classified project, dang it was pretty interesting.
@hnasr
@hnasr 3 жыл бұрын
😂 take a break
@vava-lw9ds
@vava-lw9ds 2 жыл бұрын
😂
@autohmae
@autohmae 3 жыл бұрын
You picked a great article to explain this topic. A great introduction into Sevice Workers if you want to cover it (which I fully understand if you don't want to :-) ). 6:16 my guess is /sw.js is service worker, because these fake chat conversations are how service workers work. Tip: force refresh in a browser is actually the key combo: ctrl + F5 13:49 yep, it's because you'd probably use versioning (pattern 1 in the article) in the filenames/path for the static files (CSS/JS/images). Yeah, Jake has been doing this for many years and it shows.
@hnasr
@hnasr 3 жыл бұрын
I want to cover SW and PWA but something deep inside tells we are thats over engineering the web. hey I know how to setup a proxy if I want to. I might be wrong
@autohmae
@autohmae 3 жыл бұрын
@@hnasr Actually SW and PWA are a big deal they finally make offline web apps possible. Much better than HTML5 offline support (which was a failed solution). You were the one who always said it's about the why things are done. Well, it might seem over engineering, but it's because it's meant for offline support.
@hangtran4863
@hangtran4863 2 жыл бұрын
out-of-this-world demonstration skill, thank you a lot Mr.Hussein ^^
@avi12
@avi12 3 жыл бұрын
6:16 I'm pretty sure "./sw.js" means "service worker"
@ashrafsayed1058
@ashrafsayed1058 3 жыл бұрын
for sure it is
@hnasr
@hnasr 3 жыл бұрын
You can tell I never used service workers 😅
@venkateshpachigulla
@venkateshpachigulla 2 жыл бұрын
I met Jake Archibald directly and took pic with him also in one meetup in India.
@Tsirikul1
@Tsirikul1 2 жыл бұрын
Thank you so much. Nice Video!!
@oddocid9734
@oddocid9734 2 жыл бұрын
This is relly valuable. Thanks!
@ahmedkhudhair8035
@ahmedkhudhair8035 3 жыл бұрын
Good research , Dr. Hussain Nasser 🌹
@zedmagdy
@zedmagdy 3 жыл бұрын
btw Hussein sw.js refers to ServiceWorker.js it's a good idea to talk about PWA as big companies like Microsoft started to use it on something like Office etc
@sandeepnegi4939
@sandeepnegi4939 3 жыл бұрын
These videos are so helpful love from. 🇮🇳
@kesc23
@kesc23 2 жыл бұрын
Dude, You just saved my work! LOL
@salmaanakbar
@salmaanakbar 3 жыл бұрын
Just searching for this today and you came up with. May ALLAH PAK bless you sir ❤️
@Septumsempra8818
@Septumsempra8818 Жыл бұрын
A django version of this would be gold
@sabuein
@sabuein Жыл бұрын
Thank you.
@marksaravi7160
@marksaravi7160 Жыл бұрын
You are the best ❤❤❤
@adsourcesales1037
@adsourcesales1037 Жыл бұрын
Hi, I have a problem with browser caching. Once logged in moving to pages visited previously as anonymous user, causes their cached version to be displayed. It means that “Log in” link will appear, despite the fact that user is already logged. Refreshing page will correct menu link, displaying “Log out”, but it can’t be a solution from user point of view. I have the caching plugin disabled now. I went through this issue with the hosting provider and asked them to exclude caching of pages like: /my_account/, /cart/, /checkout/ and others, but still the same situation. Please advise what can be the solution. How to make login / logout links cache independent?
@Cosmicakash
@Cosmicakash 2 жыл бұрын
Hey Hissein, with both no-cache and must-revalidate a 304 status code would be returned to the user if 80-90% of the content is like evergreen content..and this load of 304s would appear in Google search console, which is kinda issue for an SEO person...is there a smart way to avoid having 304 in GSC??
@ch94086
@ch94086 3 жыл бұрын
Great topic! Far too often I see poor back ends disable cache and set modification date as now. They want to maximize hits, even if users suffer. Many back ends are designed assuming there is no caching. On the other hand, I've had lots of problems because browsers ignore the no cache, etc. so I have to add hidden fields to forms with random numbers to disable caching. Maybe it's better now, but I'm skeptical. AOL was the worst. Hussein, hopefully you are too young to know about AOL.
@hnasr
@hnasr 3 жыл бұрын
Thanks Carl, correct some backends used to disable caching on purpose for tracking reasons. (Hulu comes to mind)
@ryanslab302
@ryanslab302 3 жыл бұрын
At one company I worked at, we had a caching issue in our SaaS solution that pissed customers off so much, so many times, the whole engineering team got laid off. We tried so hard to fix it but after every deployment, it would appear again and again. There were other problems too but telling customers to clear their cache every month to use our app was the last straw. CloudFront, CORS and .NET Core tokens. Bleh.
@hnasr
@hnasr 3 жыл бұрын
Building performant scalable apps are hard! Sorry to hear that Ryan.
@lardosian
@lardosian 3 жыл бұрын
Ryan I'm working solo in my first dev job building a PWA with AWS Amplify which uses Cloudfront, this issue is giving me nightmares and I'm beginning to hate web development because of it, throw service workers into the mix and I'm just ready to tear my hair out. Why does this have to be so complicated and difficult.
@mtnrabi
@mtnrabi 3 жыл бұрын
Why use E-Tag over saving and comparing last modified date? Also, in no-cache - isn't it a bit of an overhead of the cache always goes to the server anyways? Tell my your thoughts!
@hnasr
@hnasr 3 жыл бұрын
Modified date is great but not applicable . Resources might get updated but content didn’t really change. Or if there isn’t a static asset and the resource is dynamic (db query) Yes no-cache always go to the server but Remember we save on bandwidth, so its costly yes but less costly than no caching at all (no-store) where we always hit the server and always bring back full content
@omarabdelkader5214
@omarabdelkader5214 3 жыл бұрын
ربنا يبارك لحضرتك وكل عام وحضرتك بخير
@pajeetsingh
@pajeetsingh 3 жыл бұрын
Bro I hate to tell but you are so much better than TechLead.
@kennethkipchumba2532
@kennethkipchumba2532 3 жыл бұрын
haha
@aksidhu8121
@aksidhu8121 3 жыл бұрын
I need to implement HLS and DASH protocol for video streaming, can you please help me ,Sir. what should I do? I know only VS code.
@mrnobody1286
@mrnobody1286 3 жыл бұрын
The guy who dislike button should be removed from his videos o_O
@lardosian
@lardosian 3 жыл бұрын
This whole caching thing gives me nightmares, I just hate it.
@flaviubura4443
@flaviubura4443 3 жыл бұрын
first :)
Deep Dive into HTTP Caching: cache-control, no-cache, no-store, max-age, ETag and etc.
21:28
"كان عليّ أكل بقايا الطعام قبل هذا اليوم 🥹"
00:40
Holly Wolly Bow Arabic
Рет қаралды 9 МЛН
Watermelon magic box! #shorts by Leisi Crazy
00:20
Leisi Crazy
Рет қаралды 120 МЛН
Cool Parenting Gadget Against Mosquitos! 🦟👶 #gen
00:21
TheSoul Music Family
Рет қаралды 29 МЛН
13 Things To Remove From Your Website Immediately
12:33
Orbit Media Studios
Рет қаралды 324 М.
When you Accidentally Compromise every CPU on Earth
15:59
Daniel Boctor
Рет қаралды 860 М.
Can Professors Tell ChatGPT Papers From Student Papers?
12:21
Student Life Newspaper
Рет қаралды 47 М.
Everything you need to know about HTTP Caching
13:33
the roadmap
Рет қаралды 157 М.
MP3 CDs: a hybrid "format" that never existed, yet was surprisingly common
34:18
Technology Connections
Рет қаралды 850 М.
The ULTIMATE Email Tier List (Based Tier to Botnet Tier)
37:44
Eric Murphy
Рет қаралды 268 М.
Proxy vs Reverse Proxy Server Explained
14:18
Hussein Nasser
Рет қаралды 133 М.
What is a Browser Cache? How Do I Clear It?
6:24
Ask Leo!
Рет қаралды 10 М.
"كان عليّ أكل بقايا الطعام قبل هذا اليوم 🥹"
00:40
Holly Wolly Bow Arabic
Рет қаралды 9 МЛН