Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Bug]: crwl always bypasses the cache, -c cache_mode=enabled is ignored

クローズ 初心者向け
#2,365 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
66/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
cli

調査の方向性

まず、crwl コマンドと crwl crawl コマンドの両方で宣言されている Click オプション --bypass-cache を確認し、次に -c が適用された後に CacheMode.BYPASS を設定している if bypass_cache: ブロックを確認してください。issue にはこれらがどのファイルにあるかは書かれていないため、オプション文字列を検索してください。crwl https://example.com -o md -c cache_mode=enabled を2回実行したときに2回目でキャッシュヒットが発生し、そのフラグのデフォルト値が -c cache_mode を上書きしなくなれば完了です。

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

説明

🐞 Bug

--bypass-cache is declared as a flag with default=True, in both crwl and crwl crawl:

@click.option("--bypass-cache", "-bc", is_flag=True, default=True, help="Bypass cache when crawling")

So bypass_cache is always True, and this runs after -c / --crawler-config are applied:

if bypass_cache:
    crawler_cfg.cache_mode = CacheMode.BYPASS

Because of that, -c cache_mode=enabled (or a crawler config file that sets it) is silently ignored, and the CLI never reads or writes the cache.

Repro (0.9.4)
crwl https://example.com -o md -c cache_mode=enabled
crwl https://example.com -o md -c cache_mode=enabled

Both runs fetch the page again, and ~/.crawl4ai/crawl4ai.db never gets a crawled_data table. The same thing from Python works fine: CrawlerRunConfig(cache_mode=CacheMode.ENABLED) gives cache_status miss, then hit.

Fix idea

Make it default=False (keep the flag), or turn it into --bypass-cache/--use-cache. Then only override cache_mode when the user did not set it with -c. Today crwl bypasses the cache by default, so we probably want to keep that as the default and just let -c cache_mode=... win.

Found while looking at the community plugins in #2316. Both of them pass -c cache_mode=enabled and expect caching to work.

主要言語
Python
スター
85.4k
フォーク
8.9k
平均マージ
6日 5時間
マージ済み PR(30日)
25

環境構築

はじめの一歩

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

unclecode/crawl4ai のほかの issue

unclecode/crawl4ai の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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