Skip to content

Caching used without --cache #2103

@thomas-zahner

Description

@thomas-zahner

Running echo 'https://httpbin.org/delay/1 https://httpbin.org/delay/1' | cargo run - --max-concurrency=1 --host-stats -vv yields:

   [200] https://httpbin.org/delay/1 (at 1:1)
   [200] https://httpbin.org/delay/1 (at 1:29) | OK (cached)
🔍 2 Total (in 1s 571ms) ✅ 2 OK 🚫 0 Errors

📊 Per-host Statistics
────────────────────────────────────────────────────────────
httpbin.org   │      2 reqs │  100.0% success │   1553ms median │   50.0% cached

I feel that | OK (cached) in the second line should not show up like this unless caching is explicitly enabled. The caching already happens on the per-host specific caching which I've recently improved concerning just this case with duplicate URLs, so that duplicate URLs should never be requested twice. (given that the response is successful)

The following line causes the caching.

cache.insert(uri, status.into());

@mre @katrinafyi Do you agree that this should only happen, if caching is explicitly enabled with --cache?

based on investigating @katrinafyi's comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions