Next.js query params inside getStaticProps (Incremental Static Regeneration)? One alternative...

Опубликовано: 12 Апрель 2021
на канале: Bruno Antunes
11,688
354

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  


Смотрите видео Next.js query params inside getStaticProps (Incremental Static Regeneration)? One alternative... онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Bruno Antunes 12 Апрель 2021, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 11,688 раз и оно понравилось 354 людям.