Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-102803

Review QNetworkRequest::CacheLoadControl

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      Currently there are 4 values in the enum, AlwaysNetwork, PreferNetwork, PreferCache and AlwaysCache.

      The problem is that documentation[0] and implementation don't match, which has led to a few bug-reports [1][2].

      All of the logic relevant to this issue resides at [3].
      In short: PreferNetwork and PreferCache are not considered, at all. They always behave the same way.

      For both options Qt will check if certain Cache-Control values are set which demand us to query the source for changes, and if those are not set Qt will check if the cached content has expired, and if not, will return the cached content.

      This behavior matches neither of the two's documentation.
      There were patches written separately to make the code match their documentation counter-parts[4][5], but then a majority of the code (which implements actual sane behavior) is no longer used!

      It's unclear what the best solution is in this situation, so this issue is created in hopes of arriving at a good solution.

      [0]: https://doc.qt.io/qt-6/qnetworkrequest.html#CacheLoadControl-enum
      [1] QTBUG-81318
      [2] QTBUG-102352
      [3] https://github.com/qt/qtbase/blob/301f0a6fb025968ee73c74b8dffea1e7fe6f67e0/src/network/access/qnetworkreplyhttpimpl.cpp#L496
      [4] https://codereview.qt-project.org/c/qt/qtbase/+/296092
      [5] https://codereview.qt-project.org/c/qt/qtbase/+/406957

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              cnn Qt Core & Network
              Reporter:
              manordheim MÃ¥rten Nordheim
              PM Owner:
              Vladimir Minenko Vladimir Minenko
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes