I use WP SuperCache and W3 TotalCache to optimize the speed of my Wordpress website by caching. That really helps! But lately I have been building a website myself, basically from scratch. Is there any opensource program/code/api out there which can help me optimize (the speed of) this non-WP website (by caching) or so?
Well Website speed is not entirely dependents upon the cache only, this is one aspect and there are lot of other factors which needs to be taken care of.
memcached is one of the popular distributed memory object caching system.Beside there are lots of other heck like the number of database hots your site requires , how you portal asking browser to do caching for it.
Yahoo has published a good Blog about generic methods which should be taken care while optimizing your website for speed.
Beside this one of the core area of optimization is always your DB and application interaction with it.
The extra effort of adding proper HTML cache control tags and everything else depends largely on the environment. Tools such as
Rack::Cache can help you manage the headers on your resources.
When building websites, there are multiple aspects that will affect the perceived speed of the website.
Some best practices you need to follow are available from Yahoo and Google:
Other aspects depend on the architecture of your application, wih or without a database, static content or different content per user, and myriad other things that might have their own best practices for better performance.