views:

23

answers:

1

Hi all,

I am trying the figure out why the images (or js, or css) in the _layouts directory are not cached by either IE or FF.

The authentication on the site collection is NTLM. The _layouts folder has anonymous access enabled in IIS.

If I debug with fiddler a page that has been loaded before, I can see the following requests:

GET /_layouts/MyApplication/Images/newProject.png HTTP/1.1 401 Unauthorized

GET /_layouts/MyApplication/Images/newProject.png HTTP/1.1 401 Unauthorized

GET /_layouts/MyApplication/Images/newProject.png HTTP/1.1 200 OK

...

Cache-Control: max-age=31536000

Last-Modified: Tue, 09 Feb 2010 14:40:01 GMT

ETag: "5945d7c295a9ca1:3d0416"

...

This happens for each subsequent access of the page. Do you have any idea why the image is not cached?

Thank you

A: 

I don't think this has anything to do with Caching. Your images are simply not accessible.

Though in theory your setup should just work, I would check the following:

  • Application Pool - Make sure your sub application ('MyApplciation') is using the same App Pool as the main SharePoint site. I've encountered problem with this before, I couldn't find a solution for this so ended up assigning the same application pool.
  • IIS - If you have set up a virtual directory / application, check all of security settings. I would definately try to delete any virtual directory nodes and then seeing if I can access the images.
  • If you're using a CAS policy, try changing it to an out of the box configuration.
  • If all else fails, consider moving your images to _layouts/images/ (I know, not ideal but might be a work around)

Can't think of anything else at the moment.

Zeb
You are right, the caching is functioning. My problem is that I want to drop unnecessary authorization requests for static images. If I create an application for the folder in IIS Manager the requests do not appear anymore. I tried to make this setting in web.config as well but it doesn't seem to work:<authentication mode="Windows"/><identity impersonate="true"/><authorization><allow deny="?"/></authorization>...<location path="_layouts/IMG" allowOverride="false"><allow users="*" />
VictorG