Fix cache size &add database event