Articles tagged with: Kartones.Net

Migration to IIS 8.0 and the new blog(s)

Summary: Migrating this blog from Community Server to BlogEngine.net due to issues with the former's compatibility with IIS 8.0 and SQL Server 2012.


Kartones.Net Internet Explorer 9 Jump List

IE9 beta is out, and after giving it a try is not so bad, in fact would be a really good improvement if most of the changes weren't already present on the competitor browsers (either in stable or beta versions).

But one thing that is for sure unique and might interest heavy desktop users is the new Pinned Sites IE9 functionality. Basically allows to pin webpages to the taskbar and implement some interactive features like thumbnails, contextual menus and even overlay icons.

While Kartones.Net is not the best site to fully use this features, I can for sure place some basic shorcuts to the main sections of the site so... I've just done it:

Jumplist

Nothing impressive and done just using the <meta> tags because I didn't wanted to add javascript only for this, but it was really fast and easy to create. Remember that only works on Windows 7 and that you have to first pin the site (for example dragging the tab to the taskbar).

Another small feature to add to the IE webslice and search provider :)


Kartones.Net now featuring Twitter OAuth integration for bloggers

In january 2009 I added Twitter support for Kartones.Net, in two ways:

  • Whenever a post is added to the site (to any blog), the twitter channel gets a status update.
  • Those who wanted could add their twitter credentials (username and password) to their profile here, and their posts would generate a tweet in the given account.

Recently, Twitter announced that is removing basic authentication for security, leaving only OAuth. As usually happens with this movements, almost no library was using OAuth (because basic auth is so easy to implement) and while OAuth itself is not hard, initially I could only find PHP implementations and not .NET ones.

I tried a few implementations with custom OAuth "helpers" without luck, until Microsoft released the Web Application Toolkit for Social Network APIs. There I could finally find a correctly working OAuth helper to plug into my code (I had already integrated into Community Server all the token and approval flow and a small "Twitter Client").

Without more explanations, I'll just say that our bloggers can go to their profile and authorize this site to post on their behalf (or remove the authorization:

Kartones.Net profile settings

At Twitter's web interface you will find the new "Connection":

Twitter connection appearing

And finally the updates will have the correct source setup:

Proper tweets source working

I hope you like this new version (as it is not a new feature), much more secure.


Incoming improvements to Kartones.Net

Note: This post is more for the bloggers of Kartones.Net.

First of all, my hosting provider changes its name and gets better facilities and hardware, so I'm getting a free upgrade to Windows Server 2008, SQL Server 2008 and IIS 7. This means that the site should go a bit faster soon (I'm finally getting PHP 5 and MySQL 5 too, although I'm not using them here).

The migration will take place on one of the weekends of december (I don't know yet which one), so keep it in mind just in case the site goes down for some minutes.

Also, I found that the internal web-based post editor doesn't supports Opera or Google Chrome, so I tried to upgrade TinyMCE. Unfortunately, CS2007 comes with support for 2.x, and 3.x has breaking changes, so I'll have to do a real migration instead of a simple override of .js files. In exchange, I'll try to minimize the controls and js needed so t hat post editing loads faster than it does now (it doesn't even uses CSS sprites!).

I plan to make some small improvements to the mobile version too, the stats page is still broken (the Google Analytics part) and I have some more ideas to enhance the community.

Finally, I have a small dumb "proof of concept" project (very similar to a demo in the scope) that might end up being of more general interest than only for my "tests".


Kartones.Net CS2007 Addon 1.4, Related Posts and a bit of caching

This post is a 3x1 because I prefer to not write multiple smaller posts when they are so related.

First, I want to announce a new revision of my CS2007 Addon Pack, 1.4.0. The news are:

  • Internal refactoring of the Assembly. I've created a separate Assembly for all Kartones.Net specific features so this public one has now fewer classes and weights a few kilobytes less.
  • Internal refactoring of Twitter related components. This is still in semi-beta, but seems to work perfectly except when Twitter is down or going too slow (drop me a comment or email if it doesn't). The only downside is that now the source appears always as "web", I have to investigate it.
    I expect to finish soon with a few stuff and there will be small but interesting changes related to it.
  • RelatedPosts Community Server 2007 component. It's a blog feature that it's starting to spread, and if done correctly (I didn't check what blog engine they were using, but I've seen multiple terrible examples) can help to engage new readers to your blog.
    My implementation, altough not perfect, has the following features:
    • Searching of related posts by tags
    • 5 Results maximum
    • Caching of the results to ease SQL usage on subsequent calls
    • Only appears when viewing a single blog post. Not in a post list, not in RSS... I don't want to waste anybody's time so it's mainly focused for web visitors arriving for example from Google search results.
      related posts example

And now, the third part of the subject: a bit of caching.

As I've just mentioned, the Related Posts component caches the results for 30 minutes. In fact, the final HTML markup is cached so almost nothing is done server-side, apart from cheching the cache and retrieving the string containing the markup.
So its a per-post cache (the keys are "RELATEDPOSTS_{0}").

This approach works fast as hell, and if you have tons of visits and tons of RAM you'll be good to go. But it is really reusable?

Not really, each post ID is unique for a given post and not used anywhere else. So I made an internal version for this blog community that works differently when managing the cache.

First, as part of my CS optimization, I've created a WeblogPostLite class containing just the critical and minimal fields needed to operate with a post, returned by a new WeblogPost.GetLite() method. I plan to use it in multiple places that do heavy operations with post objecs (but using just few common fields of them), but for now, they provide me 00% serializable and fast objects.

When I search for related posts, I (as in the normal component) get 5 posts of each category (the generic component allows to choose for most viewed or most recent ordering). And here comes the trick: I insert into the cache a List<WeblogPostLite> per blog and per tag (cache key could be "RELATEDPOSTSLITE_{0}_{1}").

This caching means that for a low amount of posts, I use more memory (4-5 fields per "lite" post, up to 5 posts per category, easily 5 or 6 categories per real post,...). But as soon as visits are spread upon multiple posts, benefits start to appear: Any decently used tagging of posts will achieve a great percentage of cache hits. And the amount of memory consumed is not linear (stabilizes, unless you use insane amount of tags).

In my opinion, caching is itself not hard to do, but strategical decisions about how, what and when to optimally cache data. And as usual, is really subjective and different in each scenario.

Note: The related posts search is not perfect, and while it yields nice results most of the time, sometimes it doesn't :) I plan to do "something else" more interesting to actually have the best related results but needs one important change in CS core and, most important, time (my greatest problem, lack of free time!).