Browser application cache
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
- From Qt, offlineApplicationCache is enabled and path is also set.
- 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.
- 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.
- 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.
- 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,
Did you try your application in other browsers?
No. Not yet.
Any directions will really help
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
- We have autoloadimage set. Is it possible to intercept the http response and store them locally?
- What are the other techniques in qt that can help ?
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