Otherwa / PrivImg

Privimage Self-hosted image storage using MongoDB & Node.js. Your data, your control.
https://privimage.cyclic.cloud
2 stars 1 forks source link

Add Observer API for each img Load #7

Open Otherwa opened 12 months ago

Otherwa commented 12 months ago

Issue Description

Goal

Implement the Intersection Observer API to optimize image loading in our project.

Problem Statement

Currently, our project loads all images at once, which can lead to slower initial page load times and increased bandwidth usage. Implementing the Intersection Observer API will help us load images progressively as the user scrolls, improving the user experience and overall performance.

Proposed Solution

We should follow these steps to achieve our goal:

  1. Identify Target Images: Determine which images in our project should be loaded using the Intersection Observer API.

  2. Implement Intersection Observer: Write JavaScript code to set up the Intersection Observer. This code will monitor when target images enter the viewport and trigger their loading.

  3. Lazy Load Images: Update our image loading logic to use the Intersection Observer to load images lazily.

  4. Testing: Thoroughly test the implementation on different devices and browsers to ensure compatibility and performance improvements.

Additional Information

To-Do

Let's discuss and assign tasks to team members to get started on this optimization effort.

github-actions[bot] commented 12 months ago

Message that will be displayed on users' first issue