开发者

Caching of images and script in the _layouts directory

开发者 https://www.devze.com 2022-12-21 09:21 出处:网络
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.

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号