The Artima Developer Community
Sponsored Link

Java Buzz Forum
An interesting web application infrastructure issue

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Nick Lothian

Posts: 397
Nickname: nicklothia
Registered: Jun, 2003

Nick Lothian is Java Developer & Team Leader
An interesting web application infrastructure issue Posted: Sep 4, 2003 4:44 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Nick Lothian.
Original Post: An interesting web application infrastructure issue
Feed Title: BadMagicNumber
Feed URL: http://feeds.feedburner.com/Badmagicnumber
Feed Description: Java, Development and Me
Latest Java Buzz Posts
Latest Java Buzz Posts by Nick Lothian
Latest Posts From BadMagicNumber

Advertisement

Many web applications depend require cache control for pages, especially if they involve user logons or time-dependant data.

Usually this is achieved with HTTP headers - something like (in JSP):

response.setHeader("Cache-Control", "no-cache");
response.setHeader("Expires","Tue, 30 May 1980 14:00:41 GMT");

An alternative, which usually work well is to require your site to be run under HTTPS. In theroy, this seems ideal, since it provides security as well as cache control.

However, beware of the impact of things like reverse-proxies. Many companies are installing reverse proxies in front of their web hosting machines to do request filtering in order to provide some protection against SQL injection & XSS attacks on their websites. This is a really good idea, but there can be some unexpected impacts.

One I didn't expect was the impact on caching. Because the proxy needs to inspect the request, it decrypts it, then forwards the request as a HTTP request to the server. Many vendors list this as a feature, because it offloads some processing requirements tot he proxy-box, instead of the webserver. The catch comes if you don't have explict cache control in your pages AND the reverse proxy is a caching reverse proxy. In this case the proxy may return the cached content to the user, which is NOT WHAT YOU WANT!

Another complicating factor is that some reverse proxies forward the original HTTP 1.1 requests to the server as HTTP 1.0, and seem to ignore HTTP 1.1 headers that are returned. This can bite you if you only use the "Cache-Control" (HTTP 1.1 only) header.

Lesson: Always provide explict cache control AND expiry headers, and never rely on HTTPS to control caching for you.

Read: An interesting web application infrastructure issue

Topic: Java and shell scripts Previous Topic   Next Topic Topic: Mobile Advertising

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use