WordPress für Amazon CloudFront Caching konfigurieren?
-
-
Ich wolltemit http://wordpress.org/extend/plugins/w3-total-cache/antworten,soweitich weiß,ist dies diebeste Lösung dafür.Wasfehlt dir,was dubrauchst?I was going to answer with http://wordpress.org/extend/plugins/w3-total-cache/ , as far as I know it's the best solution for doing this. What does it lack that you need?
- 2
- 2010-08-12
- artlung
-
Ja,wasistmit W3 Total Cache,das Ihren Anforderungennichtentspricht?Yeah, what about W3 Total Cache doesn't meet your needs?
- 1
- 2010-08-12
- MikeSchinkel
-
Esging nicht wirklich darum,dassich die Antwortnicht kannte -esging darum,die Antwortfür dieganze Menschheit zu dokumentieren.;-);It wasn't really about me not knowing the answer - it's about documenting the answer for all of humanity. ;-)
- 0
- 2010-08-18
- Brent Ozar
-
2 Antworten
- Stimmen
-
- 2010-08-16
Ich denke,das W3 Total Cache Plugin kann Ihnen helfen.
I think the W3 Total Cache Plugin can help you..
-
- 2010-08-19
Das Pluginfunktionierteinwandfrei. Alternativ können Sieeine eigene Funktion verwenden,umbloginf () durch Ihre CDN-URL zuersetzen. Beispiel:
Ersetzen Sie die URLim Inhalt:
// replace content for CDN if ( !function_exists('fb_add_static_content_url') ) { function fb_add_static_content_url($content) { if ( is_admin() ) // eigentlich überflüssig return $content; $wpurl = get_bloginfo('wpurl'); $search = array( $wpurl . '/wp-content/images/', $wpurl . '/wp-content/download/', ); $replace = array( 'http://cdn1.bueltge.de/', 'http://cdn2.bueltge.de/', ); return str_replace( $search, $replace, $content ); } add_filter( 'the_content', 'fb_add_static_content_url' ); }
Ersetzen Sie Stylesheet_Directoy und andere:
// replace for CDN if ( !function_exists('fb_add_static_wpurl') ) { function fb_add_static_wpurl($info, $show) { if ( is_admin() ) return $info; $keys = array( 'url', 'wpurl', 'stylesheet_url', 'stylesheet_directory', 'template_url', 'template_directory', ); if ( in_array( $show, $keys ) ) { $wpurl = get_bloginfo('wpurl'); $search = array( $wpurl . '/wp-content/images/', $wpurl . '/wp-content/download/', $wpurl . '/wp-content/themes/', $wpurl . '/wp-content/plugins/', ); $replace = array( 'http://cdn1.bueltge.de/', 'http://cdn2.bueltge.de/', 'http://cdn3.bueltge.de/', 'http://cdn3.bueltge.de/', ); return str_replace( $search, $replace, $info ); } else { return $info; } } add_filter( 'bloginfo_url', 'fb_add_static_wpurl', 9999, 2 ); }
Ersetzen Sie dastemplate_directory und andere:
function fb_add_static_stylesheet_uri($uri) { if ( is_admin() ) return $uri; $wpurl = get_bloginfo('wpurl'); $search = array( $wpurl . '/wp-content/images/', $wpurl . '/wp-content/download/', $wpurl . '/wp-content/themes/', $wpurl . '/wp-content/plugins/', ); $replace = array( 'http://cdn1.bueltge.de/', 'http://cdn2.bueltge.de/', 'http://cdn3.bueltge.de/', 'http://cdn3.bueltge.de/', ); return str_replace( $search, $replace, $uri ); } add_filter ( 'template_directory_uri', 'fb_add_static_stylesheet_uri' ); add_filter ( 'stylesheet_uri', 'fb_add_static_stylesheet_uri' ); add_filter ( 'stylesheet_directory_uri', 'fb_add_static_stylesheet_uri' );
The plugin works fine; alternative you can use a own function to replace the bloginf() to your CDN-Url; Example:
replace the url in content:
// replace content for CDN if ( !function_exists('fb_add_static_content_url') ) { function fb_add_static_content_url($content) { if ( is_admin() ) // eigentlich überflüssig return $content; $wpurl = get_bloginfo('wpurl'); $search = array( $wpurl . '/wp-content/images/', $wpurl . '/wp-content/download/', ); $replace = array( 'http://cdn1.bueltge.de/', 'http://cdn2.bueltge.de/', ); return str_replace( $search, $replace, $content ); } add_filter( 'the_content', 'fb_add_static_content_url' ); }
replace stylesheet_directoy and others:
// replace for CDN if ( !function_exists('fb_add_static_wpurl') ) { function fb_add_static_wpurl($info, $show) { if ( is_admin() ) return $info; $keys = array( 'url', 'wpurl', 'stylesheet_url', 'stylesheet_directory', 'template_url', 'template_directory', ); if ( in_array( $show, $keys ) ) { $wpurl = get_bloginfo('wpurl'); $search = array( $wpurl . '/wp-content/images/', $wpurl . '/wp-content/download/', $wpurl . '/wp-content/themes/', $wpurl . '/wp-content/plugins/', ); $replace = array( 'http://cdn1.bueltge.de/', 'http://cdn2.bueltge.de/', 'http://cdn3.bueltge.de/', 'http://cdn3.bueltge.de/', ); return str_replace( $search, $replace, $info ); } else { return $info; } } add_filter( 'bloginfo_url', 'fb_add_static_wpurl', 9999, 2 ); }
replace the template_directory and other:
function fb_add_static_stylesheet_uri($uri) { if ( is_admin() ) return $uri; $wpurl = get_bloginfo('wpurl'); $search = array( $wpurl . '/wp-content/images/', $wpurl . '/wp-content/download/', $wpurl . '/wp-content/themes/', $wpurl . '/wp-content/plugins/', ); $replace = array( 'http://cdn1.bueltge.de/', 'http://cdn2.bueltge.de/', 'http://cdn3.bueltge.de/', 'http://cdn3.bueltge.de/', ); return str_replace( $search, $replace, $uri ); } add_filter ( 'template_directory_uri', 'fb_add_static_stylesheet_uri' ); add_filter ( 'stylesheet_uri', 'fb_add_static_stylesheet_uri' ); add_filter ( 'stylesheet_directory_uri', 'fb_add_static_stylesheet_uri' );
Amazon CloudFront istein Content Distribution Network (CDN),mit dem Sieeine große Menge überleben könnenLaden Siein kurzer Zeit.Wasist dereinfachste Weg,um WordPress so zu konfigurieren,dass seine Dateien (Medienbibliothek,CSS,Plugin-Dateien,Thema) auf S3/CloudFrontgehostet werden?
(Ich verwende derzeit W3 Total Cache,um dies zutun.)