A website in C# and jQuery will read the last post from a Twitter timeline and shows it.
I’ve found many plugins for jQuery (like Tweet!, Juitter, jQuery for Twitter, etc) and currently I’m using Juitter to do it. But I’m thinking whether this client-side approach is the best, since search crawlers will not read this content because it’s JavaScript dependent.
On the other hand, loading on the Page_Load could be a overhead to the server, since it will be waiting the Twitter response before sending the HTML back. Unless there is any way better than I thought…
Someone like one of these alternatives or suggest any other?
EDIT
Just to clarify, I will haven’t live updates after the post is loaded and shown.
Also I’m thinking if I could create some kind of cache on C# and only do requests to Twitter API again if a new post is written. This could be done?
I’d put the functionality on the client. Putting it in your C# code really isn’t giving you any benefits – except maybe in SOE – which there might be a way around (or not – I’m not that knowledgeable in SOE land).
Aside from SOE… these are what I can think of this late on Friday.
Pros to Client Side:
Pros to Server Side
You might be able to squeek away with both by loading it server side, but updating client side. call the same methods, but just do one on the first load, then use script for the rest.
Update:
For caching on twitter, I believe you can cache previous tweets so you don’t need to fetch them again. Should I output cache my control that looks up twitter RSS onload? has a topic on that.
If you’re not having live updates, then you could easily do that on the server side, or Jquery side. If you’re looking for SOE, I would opt for server side on the initial load, as that is a point you did mention.