Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to force QWebPage to store objects with no-cache in their response headers?

How to force QWebPage to store objects with no-cache in their response headers?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 613 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    a.moallemi2
    wrote on last edited by
    #1

    I'm writing a Qt program to load a webpage. Meanwhile, I want to store all the resources of the page (images, css, javascript). So, I did something like this:
    @QwebPage webpage;
    QNetworkDiskCache* diskCache = new QNetworkDiskCache(this);
    diskCache->setCacheDirectory("batch");
    webpage.networkAccessManager()->setCache(diskCache);@

    But the problem is that the first page of most of the websites come with "Cache-Control: must-revalidate" or "Pragma: no-cache" in their response headers. In these cases, QWebPage will not save the corresponding object in the cache directory. I was wondering if there is a way to bypass this and force the Qt to save all the objects in its cache regardless of those response header fields?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved