Skip to content

[FEATURE] Add pagination to blog page for improved performance and user experience #4499

@Sourya07

Description

@Sourya07

Why do we need this improvement?

Problem Statement
Currently, the AsyncAPI blog page loads all blog posts on a single page. With the blog growing continuously, this approach creates several challenges:

Performance degradation: Loading numerous posts on a single page increases page load time and bandwidth usage

Poor user experience: Users are presented with an overwhelming amount of content, making it difficult to discover and browse posts

Mobile experience: Mobile users struggle with the long scrolling required to navigate through all posts

SEO concerns: Search engines may have difficulty crawling and indexing a page with excessive content

Proposed Solution
Implement blog pagination with the following features:

Pagination Structure:

Display 10-15 blog posts per page (configurable)

Add "Previous" and "Next" navigation buttons

Display page numbers (e.g., "Page 1 of 10")

Show total number of posts

URL Structure:

Use query parameter-based URLs (e.g., /blog?page=2)

Each page gets a unique, crawlable URL

Previous/Next links use proper tags with href attributes

SEO Optimization:

Each page has its own canonical URL pointing to itself

Sequential linking between pages (first → last)

Links back to the first page from all paginated pages

Proper meta tags for pagination

User Experience:

Maintain search/filter functionality across paginated results

Show current page indicator

Clickable page numbers with sufficient target size (44×44px minimum)

Mobile-responsive pagination controls

Benefits
✅ Performance: Faster page loads, reduced bandwidth usage

✅ UX Improvement: Easier navigation and content discovery

✅ SEO: Better crawlability and indexing by search engines

✅ Scalability: Supports blog growth without performance degradation

✅ Mobile-friendly: Better experience for mobile users

Acceptance Criteria
Pagination component displays 10-15 posts per page

Navigation buttons work correctly (Previous/Next)

URL changes reflect current page (e.g., ?page=2)

Page numbers are clickable and functional

Mobile responsive design

Search/filter functionality works with pagination

Tests pass for pagination logic

SEO best practices are implemented (canonical URLs, sequential linking)

Related Resources
Google Pagination Best Practices

Current blog page

Additional Context
According to AsyncAPI's 2024 annual review, the website received over 1.1 million page views. The blog is a significant part of the community engagement strategy. Implementing pagination will enhance scalability as the blog continues to grow.

How will this change help?

For Users
Faster browsing experience: Users no longer need to scroll through dozens of posts to find what they're looking for. With paginated content, they can quickly navigate between pages and discover relevant blog posts more efficiently.

Better content discoverability: Pagination with page numbers and "Previous/Next" buttons makes it easier for users to explore the blog systematically and find older posts they might have missed.

Improved mobile experience: Mobile users will benefit significantly from shorter page loads and less scrolling, making the blog more accessible on smartphones and tablets.

Reduced cognitive overload: Instead of overwhelming users with 50+ posts on one page, pagination breaks content into digestible chunks, improving readability and engagement.

For AsyncAPI Community
Increased blog engagement: Easier navigation encourages users to spend more time browsing multiple blog posts, potentially increasing time-on-site and community engagement metrics.

Better discoverability of announcements: Community members can more easily find important announcements, release notes, and tutorial posts without excessive scrolling.

Professional appearance: A paginated blog reflects better website design practices and demonstrates the project's maturity and attention to user experience.

For SEO & Growth
Improved search engine ranking: Google prefers websites with good performance and crawlability. Pagination allows search engines to index each blog page separately, improving overall visibility.

Better Core Web Vitals: Pagination reduces page load time and improves metrics like Largest Contentful Paint (LCP) and Cumulative Layout Shift (CLS), which are ranking factors for Google Search.

Increased organic traffic: Individual paginated pages can rank for different search queries, potentially bringing more organic traffic to the blog and website.

Proper indexing: Search engines can crawl and index sequential pages more effectively with proper pagination links and canonical URLs.

For Performance & Scalability
Faster initial page load: Loading only 10-15 posts instead of all posts significantly reduces initial load time, improving user experience and reducing bounce rates.

Reduced bandwidth usage: Less data is transferred per page request, which is beneficial for users on slower connections and reduces server load.

Better scalability: As the AsyncAPI blog grows (currently with many posts across multiple years), pagination ensures the blog page remains performant regardless of the number of total posts.

Reduced database queries: Implementing pagination allows for optimized queries that only fetch the required posts per page, reducing server strain.

For the Project
Competitive advantage: Other API documentation sites (OpenAPI, GraphQL) implement pagination on their blogs. This brings AsyncAPI in line with industry best practices.

Community feedback: This feature has likely been requested or noticed by community members. Implementing it shows AsyncAPI listens to user needs.

Foundation for future features: Pagination can be a foundation for implementing additional blog features like cate

Screenshots

No response

How could it be implemented/designed?

Proposed Solution Overview
Implement blog pagination with configurable posts per page, proper URL handling, and SEO-optimized navigation.

Pagination Structure
Display 10-15 blog posts per page (configurable via blog.config.ts)

Add "Previous" and "Next" navigation buttons

Display page numbers (e.g., "Page 1 of 10")

Show total number of posts

URL Structure
Use query parameter-based URLs (e.g., /blog?page=2)

Each page gets a unique, crawlable URL

Previous/Next links use proper tags with href attributes

Support filtering across paginated results (e.g., /blog?page=2&tag=feature)

SEO Optimization
Each page has its own canonical URL pointing to itself

Sequential linking between pages (first → last)

Add pagination meta tags (rel="first", rel="prev", rel="next", rel="last")

Links back to the first page from all paginated pages

Proper meta tags for pagination

User Experience
Maintain existing search/filter functionality across paginated results

Show current page indicator

Clickable page numbers with sufficient target size (44×44px minimum for mobile accessibility)

Mobile-responsive pagination controls (show only Previous/Next on mobile)

Smooth navigation between pages

Technical Implementation
Frontend (React/Next.js):

Create reusable Pagination.tsx component

Update pages/blog/index.tsx to handle pagination

Implement getStaticProps and getStaticPaths for static generation

Use Incremental Static Regeneration (ISR) for updated content

Backend:

Update scripts/build-posts.ts to support pagination

Calculate total posts and pages

Implement post slicing for each page

SEO:

Add canonical links

Add rel="prev" and rel="next" links

Update sitemap for paginated pages

Test with Google Search Console

Acceptance Criteria
Pagination component displays 10-15 posts per page

Navigation buttons work correctly (Previous/Next)

URL changes reflect current page (e.g., ?page=2)

Page numbers are clickable and functional

Mobile responsive design (Previous/Next only on mobile)

Search/filter functionality works with pagination

Unit and E2E tests pass for pagination logic

SEO best practices are implemented (canonical URLs, sequential linking)

Page load time improves compared to current implementation

Documentation updated if needed

🚧 Breaking changes

No

👀 Have you checked for similar open issues?

  • I checked and didn't find a similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue?

Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions