Social API – Tag Patterns and other optimization thoughts

Generally, I find developers implementing scenarios, such as “As a User, I need to iterate over X Social API, so I can find the right content.”  The scenario implies that the social metadata is included, however many developers iterate over the entries in the feeds to discover the Tag metadata.  If you read the documentation parameters, you can find optimizations to include metadata in the feed request, such as:

includeTags

boolean Yes Specifies whether or not the tags that are displayed on the file welcome page are included in the returned Atom document. This parameter takes a Boolean value of either true or false. By default, the tags are not returned.

The URL Parameter that reduces the total number of requests needed. For instance, the request for a each of the 10 entries in a feed, and then the tags for those 10 entries appears to require 11 API calls with the includeTags=true it can be accomplished in one request.

You can also optimize the request by manipulating the page size – 1,10 or 25.

In some cases, you can further optimize with batch requests when creating content. Example, the Activities API enables batch deletes of Members or the OpenSocial ActivityStream API which enables batch creation of updates.

Annoyance and Figuring Out Why Using Firefox Profiler

If you ever hit the situation where a website causes your browser to hit 100% CPU usage, you should install Mozilla Firefox Profiler and then launch the Profiler Tab (Tools > Web Developer > Performance).  You can then see v4.motads.com is sucking up so many resources.  You can hit almost any major site, and see these requests.

Profiler
Profiler

I found the reason documented by the Electronic Frontier Foundation https://www.eff.org/deeplinks/2013/06/third-party-resources-nsa-leaks

 

Also, you should look at https://panopticlick.eff.org/index.php?action=log&js=yes and see how trackable you are