views:

551

answers:

2

I am using WSS 3.0 in a hosted/shared (read: can make no server-side changes) environment. Unfortunately, between SP and IIS, almost nothing is getting cached, so page loads can be terribly slow.

We have a bunch of custom image, JS, CSS, etc files that are currently just in a /img, /js, and /css directories, all of which are grabbed each and every time the page loads (server is returning "Cache-Control private,max-age=0").

Since I can't do anything with IIS, and can't enable any caching server-side on SP, do I have any other options? I've read in a few places that if your files are located in the layouts directory that they will be cached, but using SP Designer I don't seem to have access to the /___layouts directory, unless I'm missing something....

Thoughts?? Thank you!

+2  A: 

_layouts is the "repository" for application pages, i.e. pages deployed by sharepoint for performing maintenance etc. through the web UI. It is very well possilbe you don't have access to that folder, it will also not show up in SharePoint designer. You have a couple of options:

  • If you have a Publishing site, you can enable caching through the site settings.
  • What you could also do is add the @OutputCache directive to a page you create through SharePoint Designer (Outputcache on MSDN
  • deploy your site through a solution, which does allow deploying in the _layouts folder
Colin
Good information. I'll look into these -- thank you!
Mark
+4  A: 

Since you are running in a hosted/shared environment I would work directly with the ISP on this one. There are many ways to cache things and the ISP could very well prevent you from doing most of them.

Ask them the following questions...

  1. Have you set output caching on the Page Layouts directory for anon and or authenticated profiles, or at the Site level or at the Site Collection level (overview on how to here)? If not, can you?
  2. Do you have IIS set to compress static files (its not caching, but, will help)?
  3. How much RAM is available to me in this shared environment?

If you have enough RAM, look into caching your custom web parts.
You could also host your custom images, css, javascript etc on a 3rd party CDN (Akami, Amazon Web Services), that doesn't help with your theme and core js/css files.

Marc
And do they have the object cache enabled in web.config
Alex Angas
Marc - hah, why didn't I think of hosting these on a separate server? Great idea. This will offload a good percentage of these files, at least. I'll look into your other comments as well... many thanks!
Mark