如何控制什么和不能缓存作者:一个小程序?此外,任何有关如何缓存在一个小程序中工作的见解将是最受赞赏的。由Java Applet加载的缓存资源
我在applet中做了一个简单的请求,试图测试运行时加载的资源是否缓存在任何地方。
下面是发出请求的代码。我把这几次一排,都在同一个applet的生命周期:
URL url = new URL("http", "localhost", 8343, "/spring-social-test/testSession.html");
URLConnection connection = url.openConnection();
connection.setDefaultUseCaches(true);
connection.connect();
但这里是在Java小程序插件控制台输出:
network: Cache entry not found [url: http://localhost:8343/spring-social-test/index.html, version: null]
network: Connecting http://localhost:8343/spring-social-test/index.html with proxy=DIRECT
更新
刚要清楚 - 我需要知道什么情况下(图像)会被缓存,因为我正在研究基于浏览器的游戏原型,其中我的主要成本将是带宽。我需要确切知道我将使用多少带宽来探索商业模式。
谢谢,但这并没有解决我试图解决的问题。我不想清除缓存,我想知道在什么情况下运行时请求的资源将被缓存。 – 2012-07-20 08:00:07