||Many database-backed web sites deploy web caches to improve response time and system throughput. Nevertheless, database updates introduce inconsistency between the cached database-generated web pages and the corresponding database contents. This poses the problem of cache consistency maintenance for database-generated web contents. This thesis states that template-based invalidation techniques are feasible and efficient for cache consistency maintenance of database-generated web pages. We identify cached web pages and database operations by parameterized URLs (URL templates) and parameterized SQL statements (SQL templates). We then utilize the satisfiability testing algorithm in the literature to check the relationship between database queries and database updates. With the result of this testing and the correspondence between URL templates and SQL templates, we invalidate cached web pages as necessary. Furthermore, we extend the testing algorithm to handle a common class of queries (possibly with uninstantiated variables). In addition, we propose several techniques including pre-computation, indexing, group invalidation, and polling to further improve the efficiency and effectiveness of our template-based invalidation. We have implemented a template-based invalidator (TBI) using typical database-backed web site software and have conducted extensive experiments using representative benchmarks. Our experimental results clearly demonstrate the feasibility and efficiency of our template-based invalidation techniques.