Subversion
Written by: Lorna Jane Mitchell
Featured Refcardz: Top Refcardz:
  1. Git
  2. DNS
  3. Data Mining
  4. Spring Data
  5. Subversion
  1. Spring Data
  2. Subversion
  3. Spring Config.
  4. Spring Annotations
  5. Data Mining

Link Details

Link 809833 thumbnail
User 276928 avatar

By Kennard Consulting
via blog.kennardconsulting.com
Published: Jun 21 2012 / 16:44

Here's an easy-to-implement, non-intrusive, and in many cases very effective way to speed up your Java Web application. As a bonus, it should work with any Java Web application framework. It's based on the premise that while Web applications are inherently multi-user, often you don't care what other users are doing.
  • 8
  • 0
  • 1968
  • 1974

Comments

Add your comment
User 352719 avatar

Jonathan Fisher replied ago:

0 votes Vote down Vote up Reply

A little disappointed... it's a filter that returns 304s. GlassFish and TomEE seem to do this already automagically.

User 276928 avatar

Kennard Consulting replied ago:

0 votes Vote down Vote up Reply

Hi Jonathan.

Sorry if my blog wasn't helpful for you. But I'd test that assumption if I were you. Try using Firebug and seeing what gets returned.

Returning 304s isn't something you can do automagically, except for non-dynamic web sites. You really need the application to decide whether something is 'out of date' or not, particuarly if half your page is being pulled from some database.

Richard.

User 352719 avatar

Jonathan Fisher replied ago:

0 votes Vote down Vote up Reply

Hey Rich, sorry I came off like an asshat. Your blog is interesting, however, so don't make that assumption.
>
What I meant to say is that the JSF2.0 resource handler combined with GF/TomEE does a fairly good job of pushing 304s on static resources already. Most other applications these days are ajax driven and do partial form submits, so the overhead of processing is extremely low. If you have a legacy app that is using the get/post cycle I can definitely see how this would be useful.>
>
The title lead me to believe there was something magic "go fast" switch in the JVM I didn't know about, that's all I was trying to say.

User 276928 avatar

Kennard Consulting replied ago:

0 votes Vote down Vote up Reply

Yeah, apologies for the title being hyperbolic!

I agree GF/TomEE do a fairly good job of pushing 304s on static resources already. But this blog is explicitly about doing 304s on *non static* resources (i.e the Filter is mapped to *.jsf, not to *.css or *.js). AJAX aside, the JSF page can still be a significant chunk both to send over the network and to construct on the server (especially if it involves database lookups, EL evaluations and the like). I only wrote the blog because I was surprised how nicely this worked out in a client's application, under real world conditions. So may be worth a try.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (8)



Voters Against This Link (0)