Tag Info

Hot answers tagged

28

Hi @googletorp: Clearly nothing scales as well as static files served by a fast web server and any CMS that has to figure out what to load and then load it will not perform as well, WordPress or otherwise. One of the issues is the number of database queries required per URL request and my 2 prior years experience working exclusively with Drupal and now 2+ ...


22

You could install WordPress on Nginx. There are a number of resources to help: nginx Compatibility plugin HOWTO: Install WordPress On Nginx- Slicehost discussion How To Speed Up WordPress With Nginx And WP Super Cache WordPress on nginx + lighttpd + FastCGI + php Nginx as a front-end proxy cache for WordPress Some performance information from that last ...


21

On shared hosting plans your caching options are limited. You will only be able to statically cache the html output from your pages. This is the fastest way to serve pages but you loose the dynamic aspects of WordPress like making comments and seeing the latest comments on posts. There are disk caching options available for objects and database but unless ...


20

Set client-side expiries for things like css, images, JavaScript etc which don't need to be redownloaded for each page view. This, by far, made the biggest difference to my site loading times. The fastest download is the download that never happened ... # BEGIN Expire headers <IfModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus ...


18

Minimize the number of plugins you run to only what you really need. Especially be aware of plugins that add javascript and CSS code on every page load, even when that code isn't being used on the page. If you are creating your own theme from scratch, break your CSS down so that features that are only need for particular page templates or view types ...


15

My WordPress Performance and Caching Stack This is the best WordPress performance stack for a low to mid range single server or VPS. I am classifying mid range as single core with around 1G of memory and fairly fast drives. Server Stack Linux - Either Debian Lenny or Ubuntu Nginx - Configured as reverse proxy static file cache Apache - Apache will ...


12

if you want to flush the cache you can do that: the plugin has functions for that <?php flush_pgcache() //page cache flush_dbcache() // database cache flush_minify() // minify cache flush_all() //all caches ?> and you just need to call it like this: <?php $w3_plugin_totalcache->flush_all(); ?> and that is basically the answer ...


10

W3 Total Cache supports fragment caching. From FAQ: How do I implement fragment caching? Edit your templates to with the following syntax to ensure that dynamic features remain so: Example 1: <!-- mfunc any PHP code --><!-- /mfunc --> Example 2: <!-- mfunc -->any PHP code<!-- /mfunc --> Example 3: <!--MFUNC --> ...


9

Run memcached and use an object cache to reduce the number of database queries. This caches data from the database, rather than pages. Not sure if w3-total-cache already does this. Make sure you are running an opcode cache like APC. (There are several more available.)


9

Add the filemtime() of your stylesheet as a parameter: <link rel=stylesheet href="<?php echo get_stylesheet_uri() . '?t=' . filemtime( get_stylesheet_directory() . '/style.css' ); ?>"> Result: <link rel=stylesheet href="http://example.com/themes/your-theme/style.css?t=1327543705">


7

A few answers off the top of my head: 1) Minimize the number of HTTP requests the browser has to make to your host by concatenating JavaScript and CSS where possible/practical. 2) Offload as much of your image/media serving to 3rd party CDNs as possible, particularly if you're using shared hosting. 3) Try reducing the number of posts you're displaying on ...


7

@Tal, Generally speaking you should only be using one caching plugin. WP Super Cache, W3 Total Cache, Hyper Cache and DB Cache Reloaded all drop files directly in your wp-content directory and they would conflict with each other and cause errors if you were using more than one. I would recommend using W3 Total Cache because it gives you the option of ...


7

Hm, I am not sure but I think that whole cache should be invalidated on publishing of new post... Had you tried to enable debug info in W3TC and check why are those pages aren't refreshed? As for manual cache clear, from plugin's FAQ: How can I flush the cache without using the WP Admin interface? It's possible to empty the entire cache or ...


6

I remove version like this, can be easily written out to match multiple domains: add_filter( 'script_loader_src', 'jquery_unversion' ); function jquery_unversion( $src ) { if( strpos( $src, 'ajax.googleapis.com' ) ) $src = remove_query_arg( 'ver', $src ); return $src; }


6

In addition to using a disk caching plugin like wp-cache, put your blog on a host volume that has the "noatime" property set on it. Otherwise, SSH into your host (if your webhost provides that) and routinely run this command on your files every few days: chattr -R +A ~/* The ~/* means "my files under my home directory". You can change that path as you ...


5

Use a database class that is trimmed for optimization. We made good experiences with own code to reduce memory usage and database access speed. Next to that, you can optimize the database structure itself by some small changes that do a lot as well. Part of the database class code can be found in the wordpress trac, it did not made it into core (Ticket ...


5

Basic answer to "what plugin" would probably be W3 Total Cache. It is one of the most functional and actively developed plugins at moment. However complete performance chain is much longer that WordPress plugin alone can handle. Web server (Apache or something else) configuration (response time, time to first byte, headers). Database (time spent processing ...


5

Bainternet's solution didn't seem to work for me. I'm successfully using this alternative snippet within a plugin, loaded at the admin_init action: // Clear all W3 Total Cache if( class_exists('W3_Plugin_TotalCacheAdmin') ) { $plugin_totalcacheadmin = & w3_instance('W3_Plugin_TotalCacheAdmin'); $plugin_totalcacheadmin->flush_all(); ...


5

Souljacker, I would first take a look at your plugins. Star Ratings for Reviews hasn't been updated for over 3 years and looks like its real heavy on the db. I saw some raw sql with some INNER JOINS that look troublesome. On the server side you should implement some object caching. APC is the defacto standard and will give you the best results. Once ...


5

There is a hook for that: 'mce_css'. It is called in _WP_Editors::editor_settings() and you get all loaded stylesheets comma separated as the first and only parameter. Now it is easy: Use the global variable $editor_styles (here are your theme’s and parent theme’s editor stylesheets stored already), add the time of the file’s last modification as a ...


5

The most common thing to try is a content caching plugin like W3 Total Cache or WP Super Cache. Both will cache entire pages to disk, and will allow the Apache web server to completely bypass PHP processing for many page views. With W3 Total Cache, you can also cache system objects and the results of database queries, as well as using a CDN (Content ...


4

Template tags rely on global $post (unless you explicitly provide something else to those that support it. So either: they get something from that variable (no reason to go for it in database) or they don't (then they fail because they have no clue what you want) Under most normal circumstances there is no reason to worry about impact of template tags. ...


4

You have to balance speed optimization with reality. That means don't obsess over speed analytics, there is one thing you should be looking at in terms of satisfying users, load time (in most cases). Test your page un-cached and then cached, you should see a noticeable difference in how fast they load, for me your site is loading around 2.5 seconds, that ...


4

take a look at WordPress Transients API which offers a simple and standardized way of storing cached data in the database temporarily by giving it a custom name and a timeframe after which it will expire and be deleted. The transients API is very similar to the Options API but with the added feature of an expiration time, which simplifies the ...


4

While there is no inherent caching in get_bloginfo(), most of information it retrieves is from options and get_option() is cached. Holding value you need in a variable for using several time is still (marginally in most cases) faster than function call, but I wouldn't bother with explicit dedicated caching.


4

Static page cache is trade-off of resources for speed. The larger and more complex site is, the more resources it takes to cache it. Since there is no such thing as unwanted speed, static cache of small sized site is one of the best performance improvements possible. Especially on shared hosting where other tweaking options are very limited. CDN for ...


4

You can try fragment caching, from plugin's FAQ: Edit your templates to with the following syntax to ensure that dynamic features remain so: Example 1: <!-- mfunc any PHP code --><!-- /mfunc --> Example 2: <!-- mfunc -->any PHP code<!-- /mfunc --> Example 3: <!--MFUNC --> echo ...


4

The one possibility is caching broken page. For example some database query fails (which is not uncommon in shared environment and/or under load) and some page gets displayed broken / with errors. Since caching doesn't assume integrity checking it can cache such page... And your cache interval is days - page is broken as long. It would work better if ...


4

Caching the WordPress Menu also gives you a performance boost. Especially if you have a lot of Pages or a giant Menu Structure, this should be considered. Do it in 2 easy steps. At first, create a function that gets or creates the menu, instead of calling wp_nav_menu directly. function get_cached_menu( $menuargs ) { if ( !isset( $menuargs['menu'] ) ) ...


4

You might have a look at the WordPress Transient API. You should be able to store your shortcode output $total_network with set_transient( 'my_shortcode_cache', $total_network, WEEK_IN_SECONDS ); where WEEK_IN_SECONDS is a built in constant equal to 604800. You can then fetch it with: get_transient( 'my_shortcode_cache' ); If you need it to work ...



Only top voted, non community-wiki answers of a minimum length are eligible