SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I work with a sandboxed solution which is deployed in a .wsp file. The solution mostly contains our webparts. The pages that contains these webparts, are slow at startup, but it seems that there is some caching, because the next time the page is opened, it goes faster.

Our webparts contains js and css, so I thought it would be a good idea to seperate all the styling and js into seperate files and include these files.

As I have searched for information about this issue, I have understood that using customAction is the best way to include/refernce the css and js files. But my question is, will this make the loading of the pages faster?

share|improve this question
You can put the JS and CSS into separate file and upload it to Style Library of the website [if to be used in single site] or to _layouts folder [if to be used across sites].. But this has nothing to do with slow loading! And Custom Action is very different from all these, where did you read that? – Arsalan Adam Khatri Nov 22 '12 at 14:47

I wouldn't be at all sure JS and CSS file loading is causing the slowness. Try using Developer Dashboard, YSlow, Fiddler, Firebug, or other tools to determine what is causing the slowness.

Blobcache will cache the files properly, provided that it is enabled (see web.config). Also make sure it is configured to cache JS and CSS files (should be by default) - finally make sure you see some content added to the blobcache folder to verify it is really working. You can also confirm that using Fiddler.

You can also minimize JS and CSS files to make them smaller, and ensure GZIP is enabled in IIS for these (assuming they're under _layouts).

Finally, dynamically loading Javascript might be a good idea, see this for example on how to load file only when user clicks on a link.

share|improve this answer
I am pretty new to Sharepoint. My question is then, how can I configure this in a sandboxed solution? I dont have that web.config file. – gwiggen Nov 26 '12 at 10:03

The slow load times are due to the creation of the blob cache. Once made there shouldn't be any slowdown in static resources whatsoever only in the processing of webparts and live data.

share|improve this answer

Why not you try using Page output cache?

share|improve this answer
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. – Hugh Wood Dec 10 '12 at 10:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.