Missing `Access-Control-Max-Age` Header in HTTP Responses Causes Performance Issues

オープン
#2,161 コメント 1 件 リアクション 2 件 担当者 0 名 GitHub で見る

メンテナーはふだん 11 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
領域
api, performance

調査の方向性

この issue は HTTP API のレスポンスと既存の CORS allow-* ヘッダーを対象としています。まず、それらのヘッダーがどこで出力されているかを特定してください。レスポンスに Access-Control-Max-Age: 86400 が含まれ、ブラウザーの preflight 結果をキャッシュできることを確認して、完了を検証してください。

索引モデルが issue の本文から書いたものです。

説明

Description:

Version Information:

  • Version: 0.24.32
  • Commit SHA: a57ad4a2742c1cefb25d3288b33ed25c6570e0d2
  • Build Date: 2025-09-09

Problem:
The current HTTP API responses include the following headers for Cross-Origin Resource Sharing (CORS):

  • access-control-allow-headers: *
  • access-control-allow-methods: *
  • access-control-allow-origin: *

However, the Access-Control-Max-Age header is missing. This header is crucial for performance as it tells browsers how long they can cache the results of a CORS preflight request.

Without this header, the browser is forced to send a preflight OPTIONS request before every actual HTTP request to check if the CORS protocol is understood and the request is safe to send. This results in unnecessary, repetitive preflight requests, which significantly degrades the performance of front-end applications.

Suggestion:
It is recommended to add the Access-Control-Max-Age header to the HTTP responses. A suggested value is 86400 seconds (24 hours), which is the maximum value supported by Firefox.

Example:
Access-Control-Max-Age: 86400

Adding this header will allow browsers to cache the preflight response, eliminating the need for repeated OPTIONS requests and improving the overall performance and responsiveness of the front-end.

Image
主要言語
C
スター
17.3k
フォーク
562
平均マージ
10日 15時間
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

tursodatabase/libsql のほかの issue

tursodatabase/libsql の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。