Skip to content

Conversation

Copy link

Copilot AI commented Nov 30, 2025

  • Analyze the codebase and understand the issue
  • Add lazy loading to gallery images (using loading="lazy" attribute)
  • Add caching headers to /customImages/[...name]/+server.ts for long-term caching (1 year with immutable directive)
  • Send headers early before loading image content in /customImages/[...name]/+server.ts
  • Optimize image loading by using streams instead of loading entire file into memory
  • Run code review and address feedback
  • Run security check (CodeQL)
  • Add pnpm-workspace.yaml for build dependencies configuration
Original prompt

This section details on the original issue you should resolve

<issue_title>Performance issues</issue_title>
<issue_description>- The images in gallery currently (in list /[[lang]]/gallery and in specific article /[[lang]]/gallery/[id]) block main app, when loading, so user can't navigate back, or click links, because app is frozen, until all images load (so this needs to fix) and also the images should load lazy, only when person scrolls to them

  • Cache images, for images /images/[id]/+server.ts we need to add caching headers, for quite long, beacuse the image will not be changed. Also we should send headers early, before we even load the image content, so the headers came asap
  • Optimize the way of loading images, because currently it takes ages to load them (/images/[id]/+server.ts)</issue_description>

<agent_instructions>Use pnpm as package manager, don't commit any unnecesary, empty files, only update files relative to issue</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits November 30, 2025 16:17
Co-authored-by: patrick11514 <56652391+patrick11514@users.noreply.github.com>
Co-authored-by: patrick11514 <56652391+patrick11514@users.noreply.github.com>
Co-authored-by: patrick11514 <56652391+patrick11514@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix performance issues related to image loading Optimize gallery image loading with lazy loading, streaming, and long-term caching Nov 30, 2025
Copilot AI requested a review from patrick11514 November 30, 2025 16:27
@patrick11514
Copy link
Owner

@copilot Commit the pnpm-workspace.yaml :) this is actually usefull file

Co-authored-by: patrick11514 <56652391+patrick11514@users.noreply.github.com>
Copy link
Author

Copilot AI commented Nov 30, 2025

@copilot Commit the pnpm-workspace.yaml :) this is actually usefull file

Done in 7396f4d. Added pnpm-workspace.yaml with the build dependencies configuration (bcrypt, esbuild, sharp).

@patrick11514 patrick11514 marked this pull request as ready for review November 30, 2025 16:56
@patrick11514
Copy link
Owner

@copilot wait you edited the V2 branch? this should be for the V3 branch 😅

Copy link
Author

Copilot AI commented Nov 30, 2025

@copilot wait you edited the V2 branch? this should be for the V3 branch 😅

I can't change the PR's target branch directly. You can update the base branch through GitHub's PR interface (Edit button → change base branch to V3). The code changes should apply cleanly to either branch.

@patrick11514 patrick11514 changed the base branch from V2 to V3 November 30, 2025 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Performance issues

2 participants