Have you ever wondered how to access query parameters "context.req.query" inside getStaticProps???
In this video we will look at a possible "solution". This technique will only work with a CDN. We will rely on the CDN with specific headers we send from our next.js responses.
This technique will also require that we have a next.js server, which means, it will not work with "next export", which means we can't deploy to places like GitHub Pages, for example.
----
GitHub Repository: https://github.com/bmvantunes/youtube...
Deployed Demo: https://youtube-2021-april-getservers...
Cache-Control (s-maxage and stale-while-revalidate): https://developer.mozilla.org/en-US/d...
----
---- Timeline
00:00 Introduction
01:22 Introduction to ISR (Incremental Static Regeneration)
05:05 Solution
06:05 Headers that will form the solution
07:15 s-maxage timeline
08:16 s-maxage + stale-while-revalidate timeline
08:56 s-maxage + stale-while-revalidate=60 timeline
11:06 Problems to be aware - IMPORTANT!!!
15:00 With great power comes great responsibility
15:26 Problems Summary
15:54 Demo
----
----
Follow me on:
Twitter: / bmvantunes
Dev.to: https://dev.to/bmvantunes
Website: https://brunoantunes.net
GitHub: https://github.com/bmvantunes
LinkedIn: / bmvantunes
Watch video Next.js query params inside getStaticProps (Incremental Static Regeneration)? One alternative... online without registration, duration hours minute second in high quality. This video was added by user Bruno Antunes 12 April 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 11,688 once and liked it 354 people.