[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jetty-users] ProxyServlet send cached file contents
|
Hi,
On Thu, Jan 21, 2016 at 8:01 PM, Paul Johnston <pcj127@xxxxxxxxx> wrote:
> Sorry I couldn't figure this out by searching.
>
> I'm using ProxyServlet to front a locally hosted javascript
> compilation service that, when executed, compiles a bunch of *.js
> files together. It then returns the result back to the caller of the
> ProxyServlet. This compiler service is pretty slow.
>
> I'd like to cache the result of that output to a file 'app.cached.js'
> and serve the file content directly rather than callout to the
> compiler service if the cached file exists. Using a separate task,
> I'll watch for changes in the js/ filesystem tree and delete the
> app.cached.js file to ultimately trigger recompilation.
>
> What in ProxyServlet do I override to pipe the file stream to the
> response? Should I be using AsyncMiddleManServlet instead?
This may help:
https://github.com/eclipse/jetty.project/blob/master/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/ProxyServletTest.java#L791
--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.