• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Set Response Header on only Image Files

 
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I currently have a load time problem in my web application.

As I checked during friebug, my browser is not caching my images thus it request all images files everytime which slowsdown the application.
I looked up at the code and found below meta tag in all my JSP.


Any idea how can I make the browser cache only static files such as images/css/js? My app depends on AJAX to update the display so thats why I place the meta tags in most of my JSP.

Please help.

 
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Those headers are for the HTML page, not for embedded images etc. Make sure that those are served with appropriate cache headers; a tool like the Firefox plugin "LiveHTTPHeaders" can help you figure out what's going on in that regard. (Personally, I quite like HttpScoop for OS X.)
 
Mark Reyes
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Lester,

Thanks for the reply. The problem that I am seeing is that the browser especially IE is not caching my images files/css/js files. Everytime it request for these files thereby slowing my apps. I am thinking of creating a filter for myself that will intercept all url, check for any images/css/js files then add the cache control response headers on *only* these files.

I actually still am studying if what I am thinking is possible but would like to hear your thoughts regarding these.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps your browser settings are the issue?
 
Mark Reyes
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Perhaps your browser settings are the issue?



Hi Guru..

I actually dont have an idea on these. I am using IE6 as my test browser since these is what encounters most of the lagging. Can you explain alittle bit about this setting? Thanks.
 
BWA HA HA HA HA HA HA! Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic