Caching and Materialization for Web Databases