2
1
Fork
You've already forked website-old
0

Optomised api aswell as settting up cacheing to avoid rate limits and optomised images| Warning ai was. used to plan but code was then reviewed by a human #2

Closed
lawrence-mil wants to merge 5 commits from main into main
pull from: main
merge into: key:main
lawrence-mil commented 2025年09月11日 14:30:11 +02:00 (Migrated from github.com)
Copy link

This pull request introduces several optimizations and improvements across the codebase, focusing on performance, user experience, and maintainability. Key changes include adding a service worker for offline support and caching, enhancing the AniList page with dynamic loading and improved pagination, optimizing Next.js configuration for better performance, and tightening linting rules. The AniList API route is also updated for more efficient caching and support for paginated requests.

Performance and Caching Improvements

  • Added a new service worker (public/sw.js) to enable offline support and implement cache-first and network-first strategies for static assets and API requests, improving load times and resilience.
  • Updated the AniList API route (src/app/api/anilist/route.ts) to support pagination via offset and limit parameters, separated full data caching, and increased cache TTL for better performance. [1] [2] [3]

AniList Page Enhancements

  • Refactored src/app/anilist/page.tsx to use dynamic imports for AnimeCard (enabling code splitting), implemented paginated loading with "Load More" functionality per status, added background refresh, improved group sorting, and enhanced state management for a smoother user experience. [1] [2] [3] [4] [5] [6] [7] [8]

Next.js Configuration and Build Tools

  • Enhanced next.config.ts to enable compression, advanced image optimization, experimental features, conditional bundle analysis, and standalone output for improved performance and deployment flexibility.
  • Added webpack-bundle-analyzer as a dependency and introduced a build:analyze script in package.json for easier bundle analysis. [1] [2]

Linting and Code Quality

  • Strengthened linting rules in biome.json by enabling additional performance, correctness, and style checks, helping to prevent common bugs and enforce best practices.
This pull request introduces several optimizations and improvements across the codebase, focusing on performance, user experience, and maintainability. Key changes include adding a service worker for offline support and caching, enhancing the AniList page with dynamic loading and improved pagination, optimizing Next.js configuration for better performance, and tightening linting rules. The AniList API route is also updated for more efficient caching and support for paginated requests. **Performance and Caching Improvements** - Added a new service worker (`public/sw.js`) to enable offline support and implement cache-first and network-first strategies for static assets and API requests, improving load times and resilience. - Updated the AniList API route (`src/app/api/anilist/route.ts`) to support pagination via `offset` and `limit` parameters, separated full data caching, and increased cache TTL for better performance. [[1]](diffhunk://#diff-45dd75ae65a800ea175ffac223c54ed5c338f44ec173761469f22981bee83be7R9-R10) [[2]](diffhunk://#diff-45dd75ae65a800ea175ffac223c54ed5c338f44ec173761469f22981bee83be7L101-R104) [[3]](diffhunk://#diff-45dd75ae65a800ea175ffac223c54ed5c338f44ec173761469f22981bee83be7R180-R181) **AniList Page Enhancements** - Refactored `src/app/anilist/page.tsx` to use dynamic imports for `AnimeCard` (enabling code splitting), implemented paginated loading with "Load More" functionality per status, added background refresh, improved group sorting, and enhanced state management for a smoother user experience. [[1]](diffhunk://#diff-00ff31de54fff4ce8beb9d4770c10bc2ffeb5b1364169bfae36450bbc88e46ddL3-R18) [[2]](diffhunk://#diff-00ff31de54fff4ce8beb9d4770c10bc2ffeb5b1364169bfae36450bbc88e46ddR59-R61) [[3]](diffhunk://#diff-00ff31de54fff4ce8beb9d4770c10bc2ffeb5b1364169bfae36450bbc88e46ddR70-R204) [[4]](diffhunk://#diff-00ff31de54fff4ce8beb9d4770c10bc2ffeb5b1364169bfae36450bbc88e46ddL105-R217) [[5]](diffhunk://#diff-00ff31de54fff4ce8beb9d4770c10bc2ffeb5b1364169bfae36450bbc88e46ddL132-R243) [[6]](diffhunk://#diff-00ff31de54fff4ce8beb9d4770c10bc2ffeb5b1364169bfae36450bbc88e46ddL141-R283) [[7]](diffhunk://#diff-00ff31de54fff4ce8beb9d4770c10bc2ffeb5b1364169bfae36450bbc88e46ddL180-R294) [[8]](diffhunk://#diff-00ff31de54fff4ce8beb9d4770c10bc2ffeb5b1364169bfae36450bbc88e46ddL196-R314) **Next.js Configuration and Build Tools** - Enhanced `next.config.ts` to enable compression, advanced image optimization, experimental features, conditional bundle analysis, and standalone output for improved performance and deployment flexibility. - Added `webpack-bundle-analyzer` as a dependency and introduced a `build:analyze` script in `package.json` for easier bundle analysis. [[1]](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R8) [[2]](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L24-R26) **Linting and Code Quality** - Strengthened linting rules in `biome.json` by enabling additional performance, correctness, and style checks, helping to prevent common bugs and enforce best practices.
lawrence-mil commented 2025年09月11日 14:30:57 +02:00 (Migrated from github.com)
Copy link
can be viewed at " https://keiran-site-i-feel-bad.vercel.app/
lawrence-mil commented 2025年09月11日 14:32:09 +02:00 (Migrated from github.com)
Copy link

mb its broken think im running older version of next.js

mb its broken think im running older version of next.js

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
key/website-old!2
Reference in a new issue
key/website-old
No description provided.
Delete branch "main"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?