Creating cache so individual tables are only polled once
Updated caching logic for postgres