Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Who and why creates ~/Library/Caches/<my application> and how to stop it?



[+NSURLRequest (id)requestWithURL:(NSURL *)theURL cachePolicy: (NSURLRequestCachePolicy)cachePolicy timeoutInterval:(NSTimeInterval) timeoutInterval ] looks promising, but none of possible values for cachePolicy implies that data will not be cached at all. It looks like the only thing you can control is should or should not cache data be used to satisfy request.

typedef enum
{
   NSURLRequestUseProtocolCachePolicy,
   NSURLRequestReloadIgnoringCacheData,
   NSURLRequestReturnCacheDataElseLoad,
   NSURLRequestReturnCacheDataDontLoad,
} NSURLRequestCachePolicy;


On Nov 8, 2006, at 10:37 AM, John Stiles wrote:

stringWithContentsOfURL is a simple wrapper around WebKit.
If you want to customize the caching behavior, you could use WebKit directly and then I am pretty sure that there are options to control this sort of thing.
Unfortunately this might turn your one-liner into about a page of code :|


http://developer.apple.com/documentation/Cocoa/Conceptual/ DisplayWebContent/index.html#//apple_ref/doc/uid/10000164i
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ Classes/NSURLRequest_Class/Reference/Reference.html



Andrei Tchijov wrote:
Hi,
I have a small GUI-less application which register itself to listen for some system events and then communicate these events to other application via [ NSString stringWithContentsOfURL: ... ]. While looking into some other issues I have discovered the whole bunch of files in


    ~/Library/Caches/<my application name>

It is my assumption that these files are result of using "stringWithContentsOfURL:". The question is, how to prevent this from happening? In my particular case there is no reason whatsoever to cache anything.

Your advice will be highly appreciated,

Andrei Tchijov

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/jstiles% 40blizzard.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Who and why creates ~/Library/Caches/<my application> and how to stop it? (From: Andrei Tchijov <email@hidden>)
 >Re: Who and why creates ~/Library/Caches/<my application> and how to stop it? (From: John Stiles <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.