I have over 140 layers that need to appear as overlays on basemaps(Google and OSM). My users can pick and choose which layers they want to see and store them in their preferences. While we have built the solution, the performance is very slow. These layers get served with openlayers making WMS calls to GeoServer and Postgres DB.
I tried using GeoWebCache and Tilecache but then realized that they are not all that helpful when I have dynamic layers. The XML definitions of what layers to cache are static.
What are my options here? Is there a way to cache such combinations, or do I take a different route and investigate on HTTP caching with tools like Varnish?