Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Browser application cache



  • Hello All,
    Currently we are using lighttpd 1.4.32 version in our Application. We see that elements in the page[ images] are getting updated one after the other. Our application uses multiple images on a page, causing a sluggish performance. To improve we wanted to use browser application cache method

    1. From Qt, offlineApplicationCache is enabled and path is also set.
    2. application cache file is referred in the html. This cache file list all the URL of the images that needs to be cached.
      3)HTML page refers to this application cache in manifest attribute.
      Problem:
    3. We see that application cache status raises "progress" event, but does not raise "cached" event. Does it mean the files are not cached? No "Error" event is also raised.
    4. Everytime the page loads, it downloads all the contents listed in application cache and not from cache. We see in logs that it sends request to server to download all the image files.
    5. In our HTML, images to download is set as an background-image attribute. Will this method help to download the image files from application cache instead of server when the server is online and network connection is also good?

    Request your help,
    Thanks,



  • Did you try your application in other browsers?



  • No. Not yet.

    Any directions will really help
    Thanks



  • I have no experience with AppCache, but it should work. I guess you are have an error somewhere, perhaps in cache manifest



  • Me either . Is any other method where images can be cached ? We have lot of images on page which is giving performance issue

    Few questions:

    1. We have autoloadimage set. Is it possible to intercept the http response and store them locally?
    2. What are the other techniques in qt that can help ?

    Thanks,
    Radha



  • Is it possible to intercept the http response and store them locally?

    You can replace QNetworkAccessManager instance of QWebPage with object of your own subclass and intercept any requests

    What are the other techniques in qt that can help ?

    You can use standard HTTP caching, e.g. via installing QNetworkDiskCache on QNetworkAccessManager instance of QWebPage. Behavior of cache is controlled by HTTP headers


Log in to reply