ChatGPTNextWeb / ChatGPTNextWeb/NextChat

[Feature Request] Add MySQL (or SQL DB) Support for Reducing Client-Side Memory Usage in PWAs

Open
#5,706 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
88.8k
Forks
59.1k
PR merge metrics
No merged PRs in 30d

Description

### 🥰 Feature Description

Currently, when running the app on older devices, with lower RAM, such as the iPhone 10, which has limited memory, some pages reload unexpectedly due to the device's memory constraints. This is especially problematic in Progressive Web Apps (PWAs) when dealing larger model, which can consume significant memory. Since local storage is also limited and can contribute to memory bloat, running the app in WebView (as required by Apple for iOS browsers) causes the page to reload frequently without crashing the app entirely.

By adding support for MySQL or any other SQL database, the app could offload large or resource-intensive data to a backend database instead of relying heavily on client-side local storage. This would improve performance on low-memory devices and prevent page reloads caused by memory overuse.

### 🧐 Proposed Solution

Implement backend support for MySQL (or any SQL database) to store data that would otherwise be kept in local storage or processed heavily on the client side.

**This includes:**

1. Setting up API endpoints to send and retrieve data from a MySQL server.

2. Offloading large data chunks to the server.

3. Using server-side pagination or data chunking to only retrieve the necessary data from the server to reduce memory consumption on the client side.

4. Supporting various SQL DBs that allow more flexible server-side data management.

By reducing client-side memory usage through server-side storage, the app would perform more efficiently, particularly on devices iPhone 10 that are constrained by WebView limitations and memory resources.

### 📝 Additional Information

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.