The following settings can be set to limit some of the more complex MySQL queries that may be slow on large databases.
- Turn off "Hide Empty Categories", "Category Indexes" and "Show subcategory listings" under Admin->Setup->Settings->Categories
- Turn off "Hide Empty Locations", "Location Indexes" and "Show sublocation listings" under Admin->Setup->Settings->Locations
- Turn on Caching
- Optimize Database Tables
- Configure search engine crawl rates (Google information)
Depending on your website traffic and the amount of data contained in your website your server or web host may not be well suited for your website.
If you are hosted on a shared web hosting plan and have a large database and a moderate amount of traffic and experience slow downs you may want to consider upgrading to a Virtual Private Server (VPS).
If you are on a VPS and still experience slow downs you may want to consider an entry level dedicated server.
If you are on a dedicated server you may want to consider upgrading the server's processor and RAM (memory).
Lastly, if you are already on a high end dedicated server you may want to consider co-location hosting and/or load balancers.
Content Delivery Network
phpMyDirectory is compatible with content delivery networks. To enable this feature simply fill in these two values in your defaults.php file.
$CDN_URL = ''; $CDN_URL_SSL = '';
We recommend MaxCDN as a CDN provider.
Using Cloudflare may cause unexpected issues when using phpMyDirectory, specifically when logging in and submitting forms.
We suggest installing the server module "mod_cloudflare" to prevent this issue. More details:
Remote Library Loading
A wide variety of libraries are hosted on popular servers. For example jQuery is hosted by Google. When the settingAdministrator → Setup → Settings → Other → Use Remote Libraries is enabled several libraries will be loaded from other providers.
Loading libraries from other providers lowers bandwidth usage and can often speed up loading due to caching if the library was previous cached by the visitor when they visited another website which loaded the same library.
phpMyDirectory supports compression through the GZIP compression setting under:
Administrator → Setup → Settings → General → GZIP Compression
For more details about compression see this page: GZIP Compression
Expiration Headers and Caching
phpMyDirectory has an internal caching feature which caches different blocks of content as needed as long as the caching setting is turned on.
This is useful because the data in phpMyDirectory tends to change frequently (example: Recent Listings).
Header unset ETag FileETag None <FilesMatch "(?i)^.*\.(ico|flv|jpg|jpeg|png|gif|js|css)$"> Header unset Last-Modified Header set Expires "Fri, 21 Dec 2012 00:00:00 GMT" Header set Cache-Control "public, no-transform" </FilesMatch>
You may optionally control the specific age and cache-control headers by file type. An example:
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$"> Header set Cache-Control "max-age=2592000, public" </FilesMatch> <FilesMatch "\.(css)$"> Header set Cache-Control "max-age=604800, public" </FilesMatch> <FilesMatch "\.(js)$"> Header set Cache-Control "max-age=216000, private" </FilesMatch> <FilesMatch "\.(xml|txt)$"> Header set Cache-Control "max-age=216000, public, must-revalidate" </FilesMatch> <FilesMatch "\.(html|htm|php)$"> Header set Cache-Control "max-age=1, private, must-revalidate" </FilesMatch>
Keep Alive Server Settings
Many web site optimization articles and tools will encourage Keep Alive setting to be enabled.
These settings are generally enabled at the server level. Please contact your host to enable these if desired.