Add Expires or Cache-Control headers
The Expires
and Cache-Control
headers determine how long a browser should keep a resource in its cache. You should therefore use them, and configure them correctly for CSS style sheets, JavaScript scripts and images.
Ideally, these elements should be kept as long as possible so that the browser does not request them again from the server. This saves HTTP requests, bandwidth and CPU power server-side.
Use stored procedures
Stored procedures are more effective and resource efficient than SQL queries sent to the relational database management system (RDBMS) by the application server. There are two reasons for that:
- a stored procedure saves the server from interpreting the query as it is pre-compiled
- a stored procedure uses less bandwidth as there is less information transferred between the server and the client
You should therefore utilize this RDBMS function as much as possible.
All recent RDBMS (SQL Server, MySQL, PostgreSQL, etc.) support stored procedures.