ive heard that too TC supports Cache-Control, Expires and Last-Modified for cache control // Required Cache Control Headers String maxage = "86400"; // One day in Seconds response.setHeader("Cache-Control", "max-age="+ maxage);
long relExpiresInMillis = System.currentTimeMillis() + (1000 * Long.parseLong(maxage)); response.setHeader("Expires", getGMTTimeString(relExpiresInMillis)); response.setHeader("Last-Modified", getGMTTimeString(file.lastModified()));but Apache seems to implement caching primarily thru the expires module (except what the browser caches) http://httpd.apache.org/docs/2.0/mod/mod_expires.html http://www.websiteoptimization.com/speed/tweak/cache <Directory "/home/website/public_html"> Options FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all ExpiresDefault A300 <FilesMatch "\.html$"> Expires A86400 </FilesMatch> <FilesMatch "\.(gif|jpg|png|js|css)$"> Expires A2592000 </FilesMatch> </Directory> 300 second is default caching for all files...1 day caching for html files...30 days for pics and js the question i have is what happens with bascially static JS files (such as Dojo) typical Apache Server happily downloads untouched static JS files for each and every access (except for FilesMatch excps) i think component plugins such as Struts-dojo plugin a better option to cache static JS files on the TC side thanks, Martin ______________________________________________ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > Date: Tue, 23 Jun 2009 09:29:11 -0700 > Subject: Re: Struts2 static content > From: musa...@gmail.com > To: user@struts.apache.org > > this sounds like a good topic for Myth Buster > > /geek_out > > On Tue, Jun 23, 2009 at 9:25 AM, Wes Wannemacher<w...@wantii.com> wrote: > > On Tue, Jun 23, 2009 at 12:11 PM, Wes Wannemacher<w...@wantii.com> wrote: > >> On Tue, Jun 23, 2009 at 11:45 AM, Musachy Barroso<musa...@gmail.com> wrote: > >>> Struts adds overhead for serving static content. Not that I have ever > >>> done any benchmarking on it, but I know that at my company(large > >>> online retailer), just suggesting to serve static content thru tomcat > >>> instead of apache is a big offense. > >>> > >>> musachy > >>> > >> > >> I had a similar experience at a large online content provider. At the > >> time, we were bouncing back and forth between tomcat and resin. We > >> used mod_jk and mod_caucho for integration between httpd and the app > >> servers. I hate it when rules exist, but there is no data to backup > >> the rule's existence. > >> > > > > To follow that up, check out Chapter 4 of Tomcat: The Definitive > > Guide, the author goes into detail load testing Tomcat and HTTPD - > > > > http://oreilly.com/catalog/9780596101060/chapter/index.html > > > > The author does a good job of covering the tools, which I think is > > important since everyone should test for themselves. > > > > -Wes > > > > -- > > Wes Wannemacher > > Author - Struts 2 In Practice > > Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more > > http://www.manning.com/wannemacher > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > > > > > > -- > "Hey you! Would you help me to carry the stone?" Pink Floyd > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > _________________________________________________________________ Bing™ brings you maps, menus, and reviews organized in one place. Try it now. http://www.bing.com/search?q=restaurants&form=MLOGEN&publ=WLHMTAG&crea=TEXT_MLOGEN_Core_tagline_local_1x1