Re: How do i cache a JSP on the proxy?
Kesav Kumar [EMAIL PROTECTED] wrote: Yes. Oscache provides a proxy independent caching solution. This is nice and once can have programtically control over the caching. The only drawback(or good for some one) in the current implementation is all caching is memory based. All the caching is done in memory and optionally file. Well, this not lowering the number of requests on the application server. My goal is to lower the number of request on the application server, for the pages, which are made with jsp, but change hardly ever. I would like to use the proxy for this use, so that the application-server doesnt even get the requests. (We have a proxy there, so why not use it in our favour) I know that oscache speeds up the whole thing :), since we agreed to use that one inside our jsp pages. (or i must miss something, that oscache is setting headers and stuff like that, but as far as i can see, it simply caches the body tag result.. ) -- Eduard Witteveen Systeem Ontwikkelaar NOS Internet, Mediacentrum Kamer 203 +31(0)356773059 http://www.omroep.nl/ Sed quis custodiet ipsos custodes? : The sixth Satire from Juvenal
How do i cache a JSP on the proxy?
Hello, I want to cache a jsp page on the proxy (apache). My current setup is that i have apache running on port 80, with following config: VirtualHost 145.58.67.8 ServerName eduard.omroep.nl ServerAlias eduard ErrorLog /var/proxy/logs/errors CustomLog /var/proxy/logs/access common ProxyPass / http://localhost:8080/ CacheRoot /tmp/proxy /VirtualHost Furthermore the orionserver is running on port 8080, and has the following 'special' settings: frontend host=eduard.omroep.nl port=80 / For the testing purposes i have the following jsp page: %@ page session=false % %! int counter = 0; % %! // return a time back, which is +15 seconds.. public long getLastModified(HttpServletRequest request) { System.out.println(in last modified); // return 15 seconds.. return System.currentTimeMillis() * (15 * 1000) ; } % % long seconds = 15; long now = System.currentTimeMillis(); long expires = now + (seconds * 1000); response.setDateHeader(Expires, expires); System.out.println(in source.. + now + - + expires); % html body pThis page was generated on time:%= now %br / Will expire at:%= expires %br / Expire time in seconds:%= seconds %br / Count:%= counter++ %/p /body /html Everytime i request the page, the counter is increased, but this is not what i want. I want to increased at an maximum of 1 time in the 15 seconds. Can somebody help me how to accomplish this, or possible otherways to cache the jsp pages on the front proxy? greatings, -- Eduard Witteveen Systeem Ontwikkelaar NOS Internet, Mediacentrum Kamer 203 +31(0)356773059 http://www.omroep.nl/ Sed quis custodiet ipsos custodes? : The sixth Satire from Juvenal
Re: How do i cache a JSP on the proxy?
Kesav Kumar [EMAIL PROTECTED] wrote: I think your getLastModified() logic is not proper. You are sending lastmodified time as current time*15 which means the lastmodification time is newer the proxy thinks that this page got changed. Try this logic Your correct, i made a terrible misunderstanding, but i can see in the logs that this method is never called, so this isnt a sollution to my problem. -- Eduard Witteveen Systeem Ontwikkelaar NOS Internet, Mediacentrum Kamer 203 +31(0)356773059 http://www.omroep.nl/ Sed quis custodiet ipsos custodes? : The sixth Satire from Juvenal
Re: SV: When trying to parse jsp inside a servlet - 404
Magnus Rydin [EMAIL PROTECTED] wrote: Are there really a named servlet called "jsp" in your web-application? Yes, otherwise the getNamedDispatcher would return a null value, which would result in a null-pointer exception, when i call the forward method. I tried it also with "jsp-servlet" which resulted in a stack-trace (was an example of antoher webserver, and thought maybe orin had that tag also internally) code public synchronized void service(HttpServletRequest req, HttpServletResponse res) throws ServletException,IOException { RequestDispatcher disp = getServletContext().getNamedDispatcher("jsp"); disp.forward(req, res); } /code -- Eduard WitteveenSysteemontwikkelaar NOS Internet Mediacentrum Kamer 203, tel. +31(0)35 6773059 Sed quis custodiet ipsos custodes? : The sixth Satire from Juvenal
When trying to parse jsp inside a servlet - 404
Hello, I have the following method in a class derived from HttpServlet: public synchronized void service(HttpServletRequest req, HttpServletResponse res) throws ServletException,IOException { RequestDispatcher disp = getServletContext().getNamedDispatcher("jsp"); disp.forward(req, res); } and i keep getting a 404(file not found), but i have associated the file with a url-pattern, which differs from /*.jsp, so the file is there. How do i involk the com.evermind.server.http.JSPServlet, to parse this given request. p.s. im actually trying to use jsp as a preprocessor for generation of scripts which will then be converted to a binairy reponse. I hope im correct when i use the RequestDispatcher.include() with a ServletResponse(implementation), which i will convert to a String. -- Eduard WitteveenSysteemontwikkelaar NOS Internet Mediacentrum Kamer 203, tel. +31(0)35 6773059 Sed quis custodiet ipsos custodes? : The sixth Satire from Juvenal