I have an application server (Play Framework), webserver (Caddy), and database server (MariaDB with InnoDB) that are running on a single machine for now.
The database is used in two ways:
client Python code that makes highly specific SELECTs (over an SSH tunnel).
the web/application server, which performs occasional INSERTs and UPDATEs, but mostly SELECTs from large tables each time a page loads.
Is there a simple way to enable (and force) query caching for the webserver but not for the client code? My thought was to set
query_cache_type=DEMAND and use
SQL_CACHE on the webserver, but it's not ideal. Perhaps I can force JDBC to use
The unfortunate technical issue with adding
SQL_CACHE to every query is that the web application queries using Slick and a JDBC backend. The integration with Slick is tight so I can't rewrite the application layer, and I don't know how to force JDBC to append