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

QNetworkRequest::CacheLoadControlAttribute PreferNetwork does not do network request

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.8.3
    • Network: HTTP
    • None
    • macOS, Windows
    • All

    Description

      QNetworkAccessManager doesn't request a resource when a cache is set.

      QNetworkAccessManager::setCache

      I expect that when using QNetworkRequest::CacheLoadControlAttribute with PreferNetwork, I should be able to customize the cache behavior or have it handled automatically if the request header "If-Modified-Since" is set.

      By "customize," I mean receiving a status code 304 when QNetworkReply::finished is emitted.

      However, I only receive status 304 when I detach the cache from QNetworkAccessManager.

      For an example demonstrating this issue, please see imagefetcher.cpp. I've added comments within the file.

      NetworkCacheProblem.zip

      Attachments

        1. NetworkCacheProblem.zip
          6 kB
          Vasyl Hryhorzhevskyi

        Issue Links

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

          Activity

            People

              manordheim Mårten Nordheim
              vasyl Vasyl Hryhorzhevskyi
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes