Comments (6)
@LuckeeDev we currently revalidate every minute (https://github.com/my-covid-story/www/blob/main/pages/index.tsx#L39) which pulls all of the new pages down. I'm definitely curious as to why those pages were 404'ing. Two of the three seem to have fixed themselves which is even more curious.
from www.
we currently revalidate every minute (https://github.com/my-covid-story/www/blob/main/pages/index.tsx#L39) which pulls all of the new pages down.
Yep sorry, my bad. I just looked through the code and I saw the revalidation. I also just learned that Vercel supports revalidation!
I'm definitely curious as to why those pages were 404'ing. Two of the three seem to have fixed themselves which is even more curious.
Yes that's weird, the middle one is still 404'ing though.
from www.
Now they're all fixed. Do you think there's a way to avoid this weird behaviour @silent1mezzo?
from www.
I think it's an issue with the error page being returned from getStaticProps being cached on the individual story view. I didn't think that through on your PR @LuckeeDev
We should try removing that catch and see.
from www.
Yeah I can dig more into this issue today :)
from www.
I'm thinking about how we should handle this, which is also somewhat related to #126.
To me, this looks like the best approach, but I'm completely open to any suggestion:
- Instead of returning a
success
prop insidegetStaticProps()
for the[id].tsx
, we should return an object with the following structure{ notFound: true, revalidate: 60 }
as described here if the story is not found. This will allow to return a true 404 status to the client and will still revalidate the path every minute. - While the page is loading in the background, I think that we should display a loading component, to show the user that something is happening, instead of needing to wait until the full page is loaded on the server (this is only needed for the first visit to every page, but it's a nice improvement for the first user which hits that page). This change would be implemented by using
fallback: true
instead offallback: 'blocking'
as described here. - [OPTIONAL] Instead of generating all paths via
getStaticPaths()
, we should only generate the latest 20 - 50 stories and then leave the rest up to incremental static regeneration. In the long run, this will be a massive improvement.
I'm looking forward to hearing your opinion on this! @mwickett @silent1mezzo
P.S: I can work on this as soon as we choose which way to go.
from www.
Related Issues (20)
- Update schema for SEO HOT 2
- What about adding commitlint?
- Paginate story feed HOT 4
- 404 page with undraw svg HOT 2
- Make all navigation elements Next links HOT 1
- Go all in on plain text - swap out `sanitize-html` with a plain text sanitizer HOT 2
- Trim social share description content to closest sentence end. HOT 3
- Headings needs to be checked for symbols HOT 2
- Update FAQ to reflect improved story moderation requirements
- Provide filtering for the story feed HOT 1
- Previous and next links on story view HOT 1
- Nav drawer animation jank
- Update to FAQ page content HOT 1
- Display some high level site metrics on the home page HOT 2
- Allow users the ability to choose their preferred background image from a collection of stock images
- Invalid HTML on FAQ page: <p> cannot appear as a descendant of <p>
- Replace current tagline on homepage HOT 1
- Update website copy based on new mission and goals
- Media page with links to our media coverage
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from www.