Added caching conditions to database to speed up views, reports, and queries
Tweaks