Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Server push with standalone Jetty



Joakim Erdfelt / joakim@xxxxxxxxxxx

On Tue, Feb 2, 2016 at 3:19 AM, Conundrum <Conondrumk@xxxxxxxxx> wrote:
Hello

I am trying to test the server push feature on a static website with standalone Jetty.

My website consists of an index.html  + 1 CSS + a bunch of images. The directory structure is:

/Album
       |
       |-----index.html
       |-----style.css
       |------/images
                 |
                 |-----  image 1
                 |---a set of about 100 images  
                 |---image100.png


As I just wanted to quickly test out the server push feature I did not code this website as a Java Web project and, therefore, didn't have any web.xml file.

However, the Jetty documentation asks to add PushCacheFilter to web.xml. Therefore, I created a /Album/WEB-INF/web.xml in my project and added the PushCacheFilter as the documentation specified. 

This is the correct way to handle it.
 

First, I am unable to understand from the documentation how exactly PushCacheFilter works.
Secondly, I want to control which files get pushed and which do not. From the documentation, it seems PushCacheFilter doesn't give me that kind of control.


It's documented there, look at the mention of Referer.

The support for custom Push is only in jetty master branch (unstable Jetty 9.4.0) atm, which is based on an early draft of the Servlet 4.0 PushBuilder interface.

- Joakim

Back to the top