There is a table called postparsed that caches the html for a post. It's done separately for each style and language, so you would really need to check postid, styleid, and languageid to see if a given postid is cached for the current value of STYLEID and LANGUAGEID. So maybe something like:
Code:
$cached = $vbulletin->db->query_first("
SELECT * FROM " . TABLE_PREFIX . "postparsed
WHERE postid = $postid
AND styleid = " . intval(STYLEID) . "
AND languageid = " . intval(LANGUAGEID) . "
");
if ($cached)
{
/// post is cached
}