Coder Social home page Coder Social logo

basixpage's Introduction

basixpage's People

Contributors

basixkor avatar dependabot[bot] avatar xstevenyung avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

basixpage's Issues

Urql

The TTFB is still terrible (although it is miles better than Prismic) and since we serve content that won't change very much, we can leverage the existing GraphQL ecosystem to cache them aggressively.

The idea

Change the GraphQL client from current poor man's implementation to @urql/core and cache them using Graphcache since we know a lot of data can appear from various places (usually blocks).

Caching customization

Cache ArticleRecord by slugs

We rarely use ID value for ArticleRecord but it is without a doubt the most requested resource on the website. I propose to cache them by the pair of locale and slug which is unique enough to cache.

We can do this by leveraging the Local Resolvers feature of urql.

Instant invalidation

In combination with Dato's webhook feature, we can make Urql invalidate certain entities as soon as it gets updated. It can be done by using cache.invalidate.

Persistent cache

We have to rely on some sort of external persistent state because Vercel's Remix hosting is essentially a Serverless Function. We could do this by Upstash's Redis hosting with custom cache options of Graphcache.

Server-side rendering initial data

It is possible to do this using the SSR exchange, but it isn't designed well for Remix. We can work around it by using __remixContext.routeData and restoreData API.

Get rid of Pico.css

Pico.css has served this website well. However due to the nature of classless-ish CSS frameworks every time the website embeds some third-party components (like Twitter embed #6, playground #23, or YouTube #19...) we have to use Shadow DOM's style encapsulation to ensure the widget is displayed correctly.

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.