This week we focused on performance optimisation and did not make any feature updates. So it may look a little boring.
PageSpeed Insights scores show this week's work.
Before this week
After this week
Also, you can clearly feel the speed change when you open a page.
Here are some of the specific optimisations we've made this week.
Reducing the size of post list data
xLog previously used the Crossbell Indexer directly to get the list of posts, which resulted in some additional unnecessary data. We now use xLog's own API, removing the unnecessary data and using the Redis cache.
We've also added paging so that the home page will only load the first 10 posts by default until the user clicks the load more button.
Lazy loading of Markdown parsing module
We found that the Markdown parsing module is huge, so we lazy loaded it. We also removed the dependency of the home page on this module and parsed Markdown through the server slide instead. This reduced the size of js on the home page by a lot.
More elaborate caching
We have been using Redis caching on the server side for all requests to mitigate the impact of the slow indexer.
However, some requests are still time-consuming, such as finding the post id by post slug, so we optimized the caching logic for these needs.
You can check out our code changes on GitHub for a more detailed look.
Just like always, if you have any suggestions or expectations, or just want to have a casual conversation, feel free to join our community or leave a comment below. Cheers! 🍻