Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#2,365 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
66/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
cli

Direzione di ricerca

Inizia dall'opzione Click --bypass-cache dichiarata sia sul comando crwl sia su crwl crawl, poi passa al blocco if bypass_cache: che imposta CacheMode.BYPASS dopo che -c è stato applicato. L'issue non dice in quale file si trovino, quindi cerca la stringa dell'opzione. È completato quando crwl https://example.com -o md -c cache_mode=enabled, eseguito due volte, dà un cache hit alla seconda esecuzione e il valore predefinito del flag non sovrascrive più -c cache_mode.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

🐞 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.

Lingua principale
Python
Stelle
85.4k
Fork
8.9k
Merge medio
5g 13h
PR unite (30g)
28

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di unclecode/crawl4ai

Tutte le issue di unclecode/crawl4ai

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.