Coder Social home page Coder Social logo

SSG issues about www HOT 6 CLOSED

LuckeeDev avatar LuckeeDev commented on September 26, 2024
SSG issues

from www.

Comments (6)

silent1mezzo avatar silent1mezzo commented on September 26, 2024

@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.

LuckeeDev avatar LuckeeDev commented on September 26, 2024

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.

LuckeeDev avatar LuckeeDev commented on September 26, 2024

Now they're all fixed. Do you think there's a way to avoid this weird behaviour @silent1mezzo?

from www.

mwickett avatar mwickett commented on September 26, 2024

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.

LuckeeDev avatar LuckeeDev commented on September 26, 2024

Yeah I can dig more into this issue today :)

from www.

LuckeeDev avatar LuckeeDev commented on September 26, 2024

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 inside getStaticProps() 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 of fallback: '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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.