GIDForums  

Go Back   GIDForums > Web Hosting Forums > Apache Web Server Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 12-Aug-2004, 00:17
Govarthanan_k Govarthanan_k is offline
New Member
 
Join Date: Aug 2004
Posts: 1
Govarthanan_k is on a distinguished road

Tomcat Apache mod_jk2 Caching Resource File


<pre>
Hi,

With this configuration we have a servlet which basically retrieves the resource file like (image,css,xml files) many times from different URLs

Way:1 (using URLConnection )
=============================
URL siteURL = new URL(urlPath);
URLConnection siteConn = siteURL.openConnection();
siteConn.connect();
InputStreamReader isReader =new InputStreamReader(siteConn.getInputStream());

int i = -1;
StringBuffer respBuff = new StringBuffer();

while((i=isReader.read()) != -1) {
respBuff.append(String.valueOf((char)i));
}
ServletOutputStream sos = response.getOutputStream();
sos.write(sBuffer.toString().getBytes());

Way:2 (using URL )
==================
DataInputStream dis = new DataInputStream(url.openStream());
while ( dis.read(bytes) != -1) {
sos.write(bytes);
}

Problem:
=========
Actually the servlet is invoked many times for the same resources again and again. We want to avoid that and we want a way to configure a particular list of resource files(cache only which has extensions xml, gif etc) to be cached automatically by Apache.

Or other way is we can also pass an extra parameter along with the URL which decides whether this has to be cached or not. Like

192.165.121.101
this should be cached by Apache

192.165.121.101
this should not be cached by Apache

Any solution?

Thanks in Advance,
Govarthanan
</pre>
 
 

Recent GIDBlog2nd Week of IA Training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 config issues monev Apache Web Server Forum 2 28-Jun-2004 06:19
CD burner wont burn!! robertli55 Computer Hardware Forum 1 18-Jun-2004 10:53
Yet another CD burner problem: Lite-On LSC-24082K Erwin Computer Hardware Forum 1 22-May-2004 11:28
Can't view pages from another machine on the Intranet aevans Apache Web Server Forum 9 14-May-2004 02:26
[Tutorial] Standard I/O aaroncohn C Programming Language 20 27-Feb-2004 21:07

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 16:16.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.