How to cache results of of get_available_post_statuses() function as it is causing a slow query on a website with over 1 million posts?

How to cache results of of get_available_post_statuses() function as it is causing a slow query on a website with over 1 million posts?

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)