Cacheing in PHP code for plugin
You want to take a look at the CacheService class which is the service that allows you to programmatically interact with the internal cache.

This is an example of how to set some cache that expires in 3600 seconds (one hour). Set the expiration to 0 if you never want it to expire.

craft()-&gt;cache-&gt;set('some_key', 'some_value', 3600);


Just checkout CacheService for more details, as there are more methods and parameters to make use of, but this should be the basic use case.

CacheService Class Reference