Implement Logical HTTP Cache Invalidation for instant Clear-Site-Data response. [chromium/src : main]

1 view
Skip to first unread message

Deepak Ravichandran (Gerrit)

unread,
Feb 25, 2026, 7:30:30 PM (6 days ago) Feb 25
to Mike Taylor, Chromium Metrics Reviews, Christian Dullweber, AyeAye, Chromium LUCI CQ, asvitkine...@chromium.org, bnc+...@chromium.org, fenced-fra...@chromium.org, net-r...@chromium.org, gavin...@chromium.org, network-ser...@chromium.org, dullweb...@chromium.org, msrame...@chromium.org
Attention needed from Christian Dullweber

Deepak Ravichandran added 2 comments

Patchset-level comments
File-level comment, Patchset 8 (Latest):
Deepak Ravichandran . resolved

Christian - I got around to fixing this CL finally after ~8 months! This CL was heavily Gemini assisted - but I did spend quite a bit of time testing and verifying code and adjusting them.

Commit Message
Line 15, Patchset 1:A base::DoNothing() callback is used, so the browser doesn't wait for the cache to be
cleared. This makes the UI more responsive during browsing data removal.
The original synchronous behavior is preserved when the flag is disabled.
Christian Dullweber . resolved

I don't think we can make http cache deletion async. If we report a Clear-Site-Data or ClearBrowsingData deletion as done before the deletion actually happened, a website could already start loading a new page where it expects not to get any responses from the cache but if the timing goes wrong, it would still get responses from the cache that is supposed to be deleted. This would be quite confusing?

Websites can already do Clear-Site-Data asynchronous by sending it with a subresource request instead of with the main pageload, so I don't think this change would be good?

Deepak Ravichandran

I tried the solution again with Gemini 3.0 this time and with a few prompt engineering and testing - I found a async solution with consistency guarantee. I have flag guarded this change and tested it extenstively.

Open in Gerrit

Related details

Attention is currently required from:
  • Christian Dullweber
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ic4306aee801d63d4918e6f835d9c3689ff77e788
Gerrit-Change-Number: 6771670
Gerrit-PatchSet: 8
Gerrit-Owner: Deepak Ravichandran <dee...@google.com>
Gerrit-Reviewer: Christian Dullweber <dull...@chromium.org>
Gerrit-Reviewer: Deepak Ravichandran <dee...@google.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Mike Taylor <mike...@chromium.org>
Gerrit-Attention: Christian Dullweber <dull...@chromium.org>
Gerrit-Comment-Date: Thu, 26 Feb 2026 00:30:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Christian Dullweber <dull...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Deepak Ravichandran (Gerrit)

unread,
Feb 25, 2026, 7:31:10 PM (6 days ago) Feb 25
to Mike Taylor, Chromium Metrics Reviews, Christian Dullweber, AyeAye, Chromium LUCI CQ, asvitkine...@chromium.org, bnc+...@chromium.org, fenced-fra...@chromium.org, net-r...@chromium.org, gavin...@chromium.org, network-ser...@chromium.org, dullweb...@chromium.org, msrame...@chromium.org
Attention needed from Christian Dullweber

Deepak Ravichandran added 1 comment

Commit Message
Line 7, Patchset 1:This CL attempts to speed up ClearHttpCache deletion when called from
Christian Dullweber . resolved

Please also format with a single line for the title

Deepak Ravichandran

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Christian Dullweber
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ic4306aee801d63d4918e6f835d9c3689ff77e788
    Gerrit-Change-Number: 6771670
    Gerrit-PatchSet: 8
    Gerrit-Owner: Deepak Ravichandran <dee...@google.com>
    Gerrit-Reviewer: Christian Dullweber <dull...@chromium.org>
    Gerrit-Reviewer: Deepak Ravichandran <dee...@google.com>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Mike Taylor <mike...@chromium.org>
    Gerrit-Attention: Christian Dullweber <dull...@chromium.org>
    Gerrit-Comment-Date: Thu, 26 Feb 2026 00:31:03 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Christian Dullweber (Gerrit)

    unread,
    Feb 26, 2026, 10:08:15 AM (5 days ago) Feb 26
    to Deepak Ravichandran, Mike Taylor, Chromium Metrics Reviews, AyeAye, Chromium LUCI CQ, asvitkine...@chromium.org, bnc+...@chromium.org, fenced-fra...@chromium.org, net-r...@chromium.org, gavin...@chromium.org, network-ser...@chromium.org, dullweb...@chromium.org, msrame...@chromium.org
    Attention needed from Deepak Ravichandran

    Christian Dullweber added 6 comments

    Patchset-level comments
    File-level comment, Patchset 9 (Latest):
    Christian Dullweber . resolved

    This looks great, I'm excited to see the experiment results!

    File net/http/http_cache.h
    Line 293, Patchset 9 (Latest): bool IsInvalidated(disk_cache::Entry* entry);
    Christian Dullweber . unresolved

    Should we make this a method of InvalidationFilter? Then we could also more easily test the filter logic with various entries

    File net/http/http_cache.cc
    Line 1098, Patchset 9 (Latest):
    Christian Dullweber . unresolved

    Please autoformat the CL

    Line 1102, Patchset 9 (Latest): if (entry->opened() && IsInvalidated(entry->GetEntry())) {
    Christian Dullweber . unresolved

    Do we also need to check if non-opened entries are invalidated and return nullptr? (I don't really know what "opened" means here. If this is correct, then maybe add a comment why opened entries can be skipped?)

    Line 1117, Patchset 9 (Latest): if (opened && IsInvalidated(disk_entry)) {
    Christian Dullweber . unresolved

    same here

    Line 1895, Patchset 9 (Latest): invalidation_filters_.push_back(std::move(filter));
    Christian Dullweber . unresolved

    Should we enforce that end_time is at most base::Time::Now() so you can't accidentially delete future cache entries, e.g. with base::Time::Max() as end_time?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Deepak Ravichandran
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ic4306aee801d63d4918e6f835d9c3689ff77e788
      Gerrit-Change-Number: 6771670
      Gerrit-PatchSet: 9
      Gerrit-Owner: Deepak Ravichandran <dee...@google.com>
      Gerrit-Reviewer: Christian Dullweber <dull...@chromium.org>
      Gerrit-Reviewer: Deepak Ravichandran <dee...@google.com>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-CC: Mike Taylor <mike...@chromium.org>
      Gerrit-Attention: Deepak Ravichandran <dee...@google.com>
      Gerrit-Comment-Date: Thu, 26 Feb 2026 15:08:03 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Deepak Ravichandran (Gerrit)

      unread,
      Feb 27, 2026, 6:38:18 PM (4 days ago) Feb 27
      to Mike Taylor, Chromium Metrics Reviews, Christian Dullweber, AyeAye, Chromium LUCI CQ, asvitkine...@chromium.org, bnc+...@chromium.org, fenced-fra...@chromium.org, net-r...@chromium.org, gavin...@chromium.org, network-ser...@chromium.org, dullweb...@chromium.org, msrame...@chromium.org
      Attention needed from Christian Dullweber

      Deepak Ravichandran added 5 comments

      File net/http/http_cache.h
      Line 293, Patchset 9: bool IsInvalidated(disk_cache::Entry* entry);
      Christian Dullweber . resolved

      Should we make this a method of InvalidationFilter? Then we could also more easily test the filter logic with various entries

      Deepak Ravichandran

      I created a function called Matches() to address your comment for testability harness. We will still keep this function because it handles the early exit which will be true for 99,9999+% of the case.

      File net/http/http_cache.cc
      Line 1098, Patchset 9:
      Christian Dullweber . resolved

      Please autoformat the CL

      Deepak Ravichandran

      Done

      Line 1102, Patchset 9: if (entry->opened() && IsInvalidated(entry->GetEntry())) {
      Christian Dullweber . resolved

      Do we also need to check if non-opened entries are invalidated and return nullptr? (I don't really know what "opened" means here. If this is correct, then maybe add a comment why opened entries can be skipped?)

      Deepak Ravichandran

      added a comment to that effect - because unopened/new entries are guaranteed to be fresh and we should not invalidate them,.

      Line 1117, Patchset 9: if (opened && IsInvalidated(disk_entry)) {
      Christian Dullweber . resolved

      same here

      Deepak Ravichandran

      as reason as above - added a comment to that effect.

      Line 1895, Patchset 9: invalidation_filters_.push_back(std::move(filter));
      Christian Dullweber . resolved

      Should we enforce that end_time is at most base::Time::Now() so you can't accidentially delete future cache entries, e.g. with base::Time::Max() as end_time?

      Deepak Ravichandran

      great idea - added a line below to reflect this comment:
      invalidation_filter.end_time = std::min(end_time, base::Time::Now());

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Christian Dullweber
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ic4306aee801d63d4918e6f835d9c3689ff77e788
        Gerrit-Change-Number: 6771670
        Gerrit-PatchSet: 10
        Gerrit-Owner: Deepak Ravichandran <dee...@google.com>
        Gerrit-Reviewer: Christian Dullweber <dull...@chromium.org>
        Gerrit-Reviewer: Deepak Ravichandran <dee...@google.com>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: Mike Taylor <mike...@chromium.org>
        Gerrit-Attention: Christian Dullweber <dull...@chromium.org>
        Gerrit-Comment-Date: Fri, 27 Feb 2026 23:38:11 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Christian Dullweber <dull...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Christian Dullweber (Gerrit)

        unread,
        Mar 2, 2026, 7:14:13 AM (yesterday) Mar 2
        to Deepak Ravichandran, Mike Taylor, Chromium Metrics Reviews, AyeAye, Chromium LUCI CQ, asvitkine...@chromium.org, bnc+...@chromium.org, fenced-fra...@chromium.org, net-r...@chromium.org, gavin...@chromium.org, network-ser...@chromium.org, dullweb...@chromium.org, msrame...@chromium.org
        Attention needed from Deepak Ravichandran

        Christian Dullweber voted and added 2 comments

        Votes added by Christian Dullweber

        Code-Review+1

        2 comments

        Patchset-level comments
        File-level comment, Patchset 11 (Latest):
        Christian Dullweber . resolved

        lgtm!

        File net/http/http_cache.cc
        Line 1923, Patchset 11 (Latest): std::string url_str = GetResourceURLFromHttpCacheKey(entry->GetKey());
        Christian Dullweber . unresolved

        Could you parse this as GURL already so we don't need to parse it for every filter?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Deepak Ravichandran
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: Ic4306aee801d63d4918e6f835d9c3689ff77e788
          Gerrit-Change-Number: 6771670
          Gerrit-PatchSet: 11
          Gerrit-Owner: Deepak Ravichandran <dee...@google.com>
          Gerrit-Reviewer: Christian Dullweber <dull...@chromium.org>
          Gerrit-Reviewer: Deepak Ravichandran <dee...@google.com>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-CC: Mike Taylor <mike...@chromium.org>
          Gerrit-Attention: Deepak Ravichandran <dee...@google.com>
          Gerrit-Comment-Date: Mon, 02 Mar 2026 12:13:55 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Deepak Ravichandran (Gerrit)

          unread,
          Mar 2, 2026, 2:06:25 PM (yesterday) Mar 2
          to Christian Dullweber, Mike Taylor, Chromium Metrics Reviews, AyeAye, Chromium LUCI CQ, asvitkine...@chromium.org, bnc+...@chromium.org, fenced-fra...@chromium.org, net-r...@chromium.org, gavin...@chromium.org, network-ser...@chromium.org, dullweb...@chromium.org, msrame...@chromium.org

          Deepak Ravichandran added 1 comment

          File net/http/http_cache.cc
          Line 1923, Patchset 11: std::string url_str = GetResourceURLFromHttpCacheKey(entry->GetKey());
          Christian Dullweber . resolved

          Could you parse this as GURL already so we don't need to parse it for every filter?

          Deepak Ravichandran

          Done

          Open in Gerrit

          Related details

          Attention set is empty
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: Ic4306aee801d63d4918e6f835d9c3689ff77e788
            Gerrit-Change-Number: 6771670
            Gerrit-PatchSet: 12
            Gerrit-Owner: Deepak Ravichandran <dee...@google.com>
            Gerrit-Reviewer: Christian Dullweber <dull...@chromium.org>
            Gerrit-Reviewer: Deepak Ravichandran <dee...@google.com>
            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
            Gerrit-CC: Mike Taylor <mike...@chromium.org>
            Gerrit-Comment-Date: Mon, 02 Mar 2026 19:06:15 +0000
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            David Schinazi (Gerrit)

            unread,
            12:02 AM (15 hours ago) 12:02 AM
            to Deepak Ravichandran, Christian Dullweber, Mike Taylor, Chromium Metrics Reviews, AyeAye, Chromium LUCI CQ, asvitkine...@chromium.org, bnc+...@chromium.org, fenced-fra...@chromium.org, net-r...@chromium.org, gavin...@chromium.org, network-ser...@chromium.org, dullweb...@chromium.org, msrame...@chromium.org
            Attention needed from Deepak Ravichandran

            David Schinazi voted and added 3 comments

            Votes added by David Schinazi

            Code-Review+1

            3 comments

            Patchset-level comments
            File-level comment, Patchset 12 (Latest):
            David Schinazi . resolved

            Nice, this looks like a solid improvement. LGTM modulo a couple extra safety checks

            File net/http/http_cache.cc
            Line 1105, Patchset 12 (Latest): if (entry->opened() && IsInvalidated(entry->GetEntry())) {
            David Schinazi . unresolved

            Can we also protect this check behind the feature flag to be extra safe?

            Line 1122, Patchset 12 (Latest): if (opened && IsInvalidated(disk_entry)) {
            David Schinazi . unresolved

            Same

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Deepak Ravichandran
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: Ic4306aee801d63d4918e6f835d9c3689ff77e788
            Gerrit-Change-Number: 6771670
            Gerrit-PatchSet: 12
            Gerrit-Owner: Deepak Ravichandran <dee...@google.com>
            Gerrit-Reviewer: Christian Dullweber <dull...@chromium.org>
            Gerrit-Reviewer: David Schinazi <dsch...@chromium.org>
            Gerrit-Reviewer: Deepak Ravichandran <dee...@google.com>
            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
            Gerrit-CC: Mike Taylor <mike...@chromium.org>
            Gerrit-Attention: Deepak Ravichandran <dee...@google.com>
            Gerrit-Comment-Date: Tue, 03 Mar 2026 05:02:21 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages