One way to optimize WordPress is to install WP Super Cache, which you can do from your WordPress Dashboard under Plugins.
Suggested Settings
Please complete all four (4) steps to use the suggested settings.
(Click on any of the images for a larger version.)
On the Advanced tab:
When selecting between Use mod_rewrite to serve cache files and 304 Not Modified browser caching, Please note that 304 Not Modified browser caching will not be selectable as long as you have Use mod_rewrite in use. You will need to use one or the other, as recent updates to the WP Super Cache Plugin have made the use of both inaccessible at this time.
Check the box next to Cache hits to this website…
Select the button next to Use mod_rewrite to serve cache files
Check the box next to Compress Pages
Check the box next to 304 Not Modified browser caching
Check the box next to Don’t cache pages for known users
Cache rebuild & Extra homepage checks should already be checked, leave them that way.
Select the Update Status button.
Then, scroll down and select Update Mod_Rewrite Rules in the yellow box.
Scroll down to Expiry Time & Garbage Collection and enter 3600 In the box, then select Change Expiration
It is recommended that you do not remove the default user agents from the list, to prevent bots from caching content and pages not normally seen by your visitors.
Explanation of the Options Selected
Cache hits to this website…
Enables caching
Use mod_rewrite to serve cache files
The fastest caching method uses mod_rewrite rules in the client’s .htaccess file
Super Cache files are compressed and stored that way so the heavy compression is done only once. These files are generally much smaller and are sent to a visitor’s browser much more quickly than uncompressed html. As a result, the server spends less time talking over the network which saves CPU time and bandwidth, and can also serve the next request much more quickly.
Indicates to the client’s browser whether a requested file has been modified or not (see: http://www.addedbytes.com/for-beginners/http-status-codes/ or elsewhere for more info on that Apache code)
This prevents logged-in users from being served cached pages and is the default for almost every caching plugin out there.
The default setting will allow cache files to age 1 hour (3600 seconds) before being removed which is ideal. This setting can be increased for sites that do not have many posts (1,000 or less ) if you do not update your content often. If you have a very large amount of posts ( 25,000+ ), a lower setting around 1800 may be more viable to prevent stat/CPU issues due to the amount of files being created.
It is recommended that you do not remove the default user agents from the list, to prevent bots from caching content and pages not normally seen by your visitors. (For example, if you have a calendar, a real visitor may only browse months close to now, but a bot will index every month forever as if it is a different page. Caching these pages real visitors are unlikely to visit wastes resources.)