Enabling Caching in Web-kit based cocoa application

  • Hi All,

            I'm new to Webkit-Cocoa world , Pls bear with me if the question
    looks simple enough.

            I've a cocoa application which shows my local app server pages. I'm
    loading the pages using following code snippet.

          [[webView mainFrame] requestWithURL:[NSURL
    URLWithString:urlString]]];

              When ever i try to load a new page , its taking same time(2-3
    sec) to load page every time. But when i try to open my page using Safari,
    its taking time for the first , next subsequent loads take no time ( less
    that 1/2 sec ).

              I think the problem could be cache issue. I'm also planning
    to cache images inside a page , which will reduce most of the traffic.

              Is there any way to provide caching capability to web-view in a
    cocoa application

              Please provide some pointers on resolving this issue . Thanks in
    Advance.

    -JanakiRam.
  • If you're on 10.5, check out -[WebPreferences setCacheModel:] and
    maybe -[WebPreferences setUsesPageCache:].

    These don't seem to be documented outside of the headers right now,
    for which I'm filing a bug.  I think the default behavior in Tiger was
    that all apps cached like Safari, whereas now a web browser-like app
    needs to specifically ask for Safari-like caching.  This improves
    memory usage for apps that use WebViews for tasks other than web
    browsing.  For example, Adium uses a WebView to display a
    conversation.

    -Ken

    On Dec 5, 2007 11:09 PM, JanakiRam <johnyatforums...> wrote:
    > Hi All,
    >
    > I'm new to Webkit-Cocoa world , Pls bear with me if the question
    > looks simple enough.
    >
    > I've a cocoa application which shows my local app server pages. I'm
    > loading the pages using following code snippet.
    >
    > [[webView mainFrame] requestWithURL:[NSURL
    > URLWithString:urlString]]];
    >
    > When ever i try to load a new page , its taking same time(2-3
    > sec) to load page every time. But when i try to open my page using Safari,
    > its taking time for the first , next subsequent loads take no time ( less
    > that 1/2 sec ).
    >
    > I think the problem could be cache issue. I'm also planning
    > to cache images inside a page , which will reduce most of the traffic.
    >
    > Is there any way to provide caching capability to web-view in a
    > cocoa application
    >
    > Please provide some pointers on resolving this issue . Thanks in
    > Advance.
    >
    > -JanakiRam.
    >
  • Please don't post the same question to multiple lists. It can easily
    result in folks spending time answering your question without knowing
    that someone else answered your question on another list.

    If you are asking about WebKit likely stick to the webkitsdk-dev list.

    -Shawn
previous month december 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today