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

QNetworkDiskCache does not handle 'no-cache' directive of Cache-Control in HTTP response header properly

    XMLWordPrintable

    Details

    • Platform/s:
      All
    • Commits:
      9e61cec7915ca177e88bd685a3229f153ee7ab7a (qt/qtbase/5.12)

      Description

      Current implementation for 'no-cache' directive of Cache-Control in HTTP response header is incorrect. It should not be same with 'no-store'. There is condition to use cache.

      https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#Cacheability

      no-cache: {{}}Forces caches to submit the request to the origin server for validation before releasing a cached copy.

       

      Current codes in head are here:
      http://code.qt.io/cgit/qt/qtbase.git/tree/src/network/access/qnetworkreplyhttpimpl.cpp#n1741

      QNetworkCacheMetaData QNetworkReplyHttpImplPrivate::fetchCacheMetaData(const QNetworkCacheMetaData &oldMetaData) const
      {
      ...
              // HTTP/1.1. Check the Cache-Control header
              if (cacheControl.contains("no-cache"))
                  canDiskCache = false;
              else if (cacheControl.contains("no-store"))
                  canDiskCache = false;
      
      

       

       

        Attachments

        For Gerrit Dashboard: QTBUG-71896
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            manordheim Mårten Nordheim
            Reporter:
            akizawa Akihito Izawa
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes