WP Super Cache

Beschreibung

This plugin generates static html files from your dynamic WordPress blog. After a html file is generated your webserver will serve that file instead of processing the comparatively heavier and more expensive WordPress PHP scripts.

The static html files will be served to the vast majority of your users:

  • Users who are not logged in.
  • Users who have not left a comment on your blog.
  • Or users who have not viewed a password protected post.

99% deiner Besucher werden statische HTML-Dateien erhalten. Eine Cache-Datei kann tausende Male bedient werden. Andere Besucher werden mit individuellen Cache-Dateien versorgt, die auf ihren Besuch zugeschnitten sind. Wenn sie angemeldet sind oder Kommentare hinterlassen haben, werden diese Details angezeigt und zwischengespeichert.

The plugin serves cached files in 3 ways (ranked by speed):

  1. Expert. The fastest method is by using Apache mod_rewrite (or whatever similar module your web server supports) to serve „supercached“ static html files. This completely bypasses PHP and is extremely quick. If your server is hit by a deluge of traffic it is more likely to cope as the requests are „lighter“. This does require the Apache mod_rewrite module (which is probably installed if you have custom permalinks) and a modification of your .htaccess file which is risky and may take down your site if modified incorrectly.
  2. Simple. Supercached static files can be served by PHP and this is the recommended way of using the plugin. The plugin will serve a „supercached“ file if it exists and it’s almost as fast as the mod_rewrite method. It’s easier to configure as the .htaccess file doesn’t need to be changed. You still need a custom permalink. You can keep portions of your page dynamic in this caching mode.
  3. WP-Cache caching. This is mainly used to cache pages for known users, URLs with parameters and feeds. Known users are logged in users, visitors who leave comments or those who should be shown custom per-user data. It’s the most flexible caching method and slightly slower. WP-Cache caching will also cache visits by unknown users if supercaching is disabled. You can have dynamic parts to your page in this mode too. This mode is always enabled but you can disable caching for known users, URLs with parameters, or feeds separately. Set the constant „DISABLE_SUPERCACHE“ to 1 in your wp-config.php if you want to only use WP-Cache caching.

Wenn du dich mit der Bearbeitung von PHP-Dateien nicht wohlfühlst, dann benutze den einfachen Modus. Er ist einfach einzurichten und sehr schnell.

Empfohlene Einstellungen

  1. Simple caching.
  2. Compress pages.
  3. Don’t cache pages for known users.
  4. Cache rebuild.
  5. CDN support.
  6. Extra homepage checks.

Die Garbage Collection ist der Akt der Bereinigung von Cache-Dateien, die veraltet und abgestanden sind. Es gibt keinen korrekten Wert für die Verfallszeit, aber ein guter Ausgangspunkt sind 1800 Sekunden.

Erwäge den Inhalt der Textbox „Abgelehnte User Agents“ zu löschen und lasse Suchmaschinen Dateien für dich zwischenspeichern.

Preload as many posts as you can and enable „Preload Mode“. Garbage collection of old cached files will be disabled. If you don’t care about sidebar widgets updating often set the preload interval to 2880 minutes (2 days) so all your posts aren’t recached very often. When the preload occurs the cache files for the post being refreshed is deleted and then regenerated. Afterwards a garbage collection of all old files is performed to clean out stale cache files.
Even with preload mode enabled cached files will still be deleted when posts are modified or comments made.

Entwicklung

  • Die aktive Entwicklung dieses Plugins wird auf GitHub durchgeführt.
  • Die Übersetzung des Plugins in verschiedene Sprachen findest du auf der Übersetzungsseite.

Dokumentation

If you need more information than the following, you can have a look at the wiki or the Developer documentation.

Vorladen

Du kannst Cache-Dateien für die Beiträge, Kategorien und Schlagworte deiner Website generieren, indem du sie vorinstallierst. Das Preloading besucht jede Seite deiner Website und erzeugt eine zwischengespeicherte Seite, genau wie jeder andere Besucher der Website. Aufgrund der sequentiellen Natur dieser Funktion kann es einige Zeit dauern, bis eine komplette Website vorgeladen ist, wenn es viele Beiträge gibt.
Um das Vorladen effektiver zu gestalten, kann es sinnvoll sein, die Garbage Collection zu deaktivieren, damit ältere Cache-Dateien nicht gelöscht werden. Dies geschieht durch Aktivieren von „Preload Mode“ in den Einstellungen. Beachte jedoch, dass Seiten irgendwann veraltet sind, aber dass Aktualisierungen durch Einreichen von Kommentaren oder Bearbeiten von Beiträgen Teile des Caches leeren werden.

Garbage Collection

Dein Cache-Verzeichnis füllt sich im Laufe der Zeit, was Platz auf deinem Server einnimmt. Wenn der Platz begrenzt ist oder nach Kapazität abgerechnet wird, oder wenn du befürchtest, dass die zwischengespeicherten Seiten deiner Website veraltet sind, dann muss die Müllabfuhr durchgeführt werden. Die Garbage Collection findet regelmäßig statt und löscht alte Dateien im Cache-Verzeichnis. Auf der Seite mit den erweiterten Einstellungen kannst du Folgendes angeben:
1. Cache-Timeout. Wie lange Cache-Dateien als frisch gelten. Nach dieser Zeit sind sie veraltet und können gelöscht werden.
2. Zeitplaner. Lege fest, wie oft die Garbage Collection durchgeführt werden soll.
3. Benachrichtigungs-E-Mails. Du kannst über den Fortschritt der Garbage Collection informiert werden.
Es gibt keine richtigen oder falschen Einstellungen für die Garbage Collection. Es hängt von deiner eigenen Website ab.
Wenn deine Website regelmäßig aktualisiert oder kommentiert wird, stelle den Timeout auf 1800 Sekunden und den Timer auf 600 Sekunden ein.
Wenn deine Website überwiegend statisch ist, kannst du die Garbage Collection deaktivieren, indem du 0 als Timeout eingibst oder einen wirklich großen Timeout-Wert verwendest.

The cache directory, usually wp-content/cache/ is only for temporary files. Do not ever put important files or symlinks to important files or directories in that directory. They will be deleted if the plugin has write access to them.

CDN

A Content Delivery Network (CDN) is usually a network of computers situated around the world that will serve the content of your website faster by using servers close to you. Static files like images, Javascript and CSS files can be served through these networks to speed up how fast your site loads. You can also create a „poor man’s CDN“ by using a sub domain of your domain to serve static files too.

OSSDL CDN off-linker has been integrated into WP Super Cache to provide basic CDN support. It works by rewriting the URLs of files (excluding .php files) in wp-content and wp-includes on your server so they point at a different hostname. Many CDNs support origin pull. This means the CDN will download the file automatically from your server when it’s first requested, and will continue to serve it for a configurable length of time before downloading it again from your server.

Configure this on the „CDN“ tab of the plugin settings page. This is an advanced technique and requires a basic understanding of how your webserver or CDNs work. Please be sure to clear the file cache after you configure the CDN.

REST-API

Es gibt nun REST-API-Endpunkte für den Zugriff auf die Einstellungen dieses Plugins. Nur wenn du als Admin-Benutzer angemeldet bist, hast du die Berechtigung, die Einstellungsseite anzuzeigen, um sie zu verwenden. Dies ist noch nicht dokumentiert, aber du kannst den gesamten Code, der sich damit beschäftigt, im Verzeichnis „rest“ finden.

Custom Caching

It is now possible to hook into the caching process using the add_cacheaction() function.

Drei Hooks sind verfügbar:

  1. ‚wp_cache_get_cookies_values‘ – modify the key used by WP Cache.
  2. ‚add_cacheaction‘ – runs in phase2. Allows a plugin to add WordPress hooks.
  3. ‚cache_admin_page‘ – runs in the admin page. Use it to modify that page, perhaps by adding new configuration options.

There is one regular WordPress filter too. Use the „do_createsupercache“ filter
to customize the checks made before caching. The filter accepts one parameter.
The output of WP-Cache’s wp_cache_get_cookies_values() function.

WP Super Cache verfügt über ein eigenes Plugin-System. Dieser Code wird beim Laden von WP Super Cache geladen und kann benutzt werden, um die Art und Weise der Zwischenspeicherung zu ändern. Dies geschieht, bevor die meisten WordPress-Dateien geladen werden, so dass einige Funktionen nicht verfügbar sind. Plugins können sich überall dort befinden, wo PHP sie laden kann. Du kannst auch dein eigenes Plugin hinzufügen:

  • indem du dein Plugin in das Verzeichnis wp-content/plugins/wp-super-cache-plugins legst, oder
  • durch den Aufruf von wpsc_add_plugin( $name ), wobei $name der vollständige Dateiname und Pfad zum Plugin ist. Du musst diese Funktion nur einmal aufrufen, um sie hinzuzufügen. Benutze wpsc_delete_plugin( $name ), um sie aus der Liste der geladenen Plugins zu entfernen.

Die Cookies, die der WP Super Cache zur Identifizierung „bekannter Benutzer“ verwendet, können nun geändert werden, indem die Namen dieser Cookies in der Plugin-Konfiguration zu einer Liste hinzugefügt werden. Verwende wpsc_add_cookie( $name), um ein neues Cookie hinzuzufügen, und wpsc_delete_cookie( $name), um es zu entfernen. Die Cookie-Namen modifizieren auch die vom Plugin verwendeten mod_rewrite Regeln, aber ich empfehle die Verwendung des Simple Mode Caching, um Komplikationen beim Aktualisieren der .htaccess-Datei zu vermeiden.
Der Cookie-Name und -Wert werden verwendet, um Benutzer zu unterscheiden, so dass du z.B. ein Cookie haben kannst, aber unterschiedliche Werte für jeden Typ von Benutzern auf deiner Website. Sie werden mit verschiedenen Cache-Dateien bedient.

Siehe plugins/searchengine.php als Beispiel für mein No Adverts for Friends Plugin.

Problembehandlung

If things don’t work when you installed the plugin here are a few things to check:

  1. Is wp-content writable by the web server?
  2. Is there a wp-content/wp-cache-config.php ? If not, copy the file wp-super-cache/wp-cache-config-sample.php to wp-content/wp-cache-config.php and make sure WPCACHEHOME points at the right place.
  3. Is there a wp-content/advanced-cache.php ? If not, then you must copy wp-super-cache/advanced-cache.php into wp-content/. You must edit the file and change the path so it points at the wp-super-cache folder.
  4. If pages are not cached at all, remove wp-content/advanced-cache.php and recreate it, following the advice above.
  5. Make sure the following line is in wp-config.php and it is ABOVE the „require_once(ABSPATH.’wp-settings.php‘);“ line:

    define( 'WP_CACHE', true );
    
  6. Try the Settings->WP Super Cache page again and enable cache.
  7. Look in wp-content/cache/supercache/. Are there directories and files there?
  8. Anything in your php error_log?
  9. If your browser keeps asking you to save the file after the super cache is installed you must disable Super Cache compression. Go to the Settings->WP Super Cache page and disable it there.
  10. The plugin does not work very well when PHP’s safe mode is active. This must be disabled by your administrator.
  11. If pages are randomly super cached and sometimes not, your blog can probably be viewed with and without the „www“ prefix on the URL. You should choose one way and install the Enforce www preference plugin if you are using an old WordPress install. The latest versions redirect themselves (you should always be running the latest version of WordPress anyway!)
  12. Private Server users at Dreamhost should edit wp-content/wp-cache-config.php and set the cache dir to „/tmp/“ if they are getting errors about increasing CPU usage. See this discussion for more.
  13. File locking errors such as „failed to acquire key 0x152b: Permission denied in…“ or „Page not cached by WP Super Cache. Could not get mutex lock.“ are a sign that you may have to use file locking. Edit wp-content/wp-cache-config.php and uncomment „$use_flock = true“ or set $sem_id to a different value. You can also disable file locking from the Admin screen as a last resort.
  14. Make sure cache/wp_cache_mutex.lock is writable by the web server if using coarse file locking.
  15. The cache folder cannot be put on an NFS or Samba or NAS share. It has to be on a local disk. File locking and deleting expired files will not work properly unless the cache folder is on the local machine.
  16. Garbage collection of old cache files won’t work if WordPress can’t find wp-cron.php. If your hostname resolves to 127.0.0.1 it could be preventing the garbage collection from working. Check your access_logs for wp-cron.php entries. Do they return a 404 (file not found) or 200 code? If it’s 404 or you don’t see wp-cron.php anywhere WordPress may be looking for that script in the wrong place. You should speak to your server administator to correct this or edit /etc/hosts on Unix servers and remove the following line. Your hostname must resolve to the external IP address other servers on the network/Internet use. See http://yoast.com/wp-cron-issues/ for more. A line like „127.0.0.1 localhost localhost.localdomain“ is ok.

    127.0.0.1 example.com
    
  17. If old pages are being served to your visitors via the supercache, you may be missing Apache modules (or their equivalents if you don’t use Apache). 3 modules are required: mod_mime, mod_headers and mod_expires. The last two are especially important for making sure browsers load new versions of existing pages on your site.
  18. The error message, „WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed!“ appears at the end of every page. Open the file wp-content/advanced-cache.php in your favourite editor. Is the path to wp-cache-phase1.php correct? This file will normally be in wp-content/plugins/wp-super-cache/. If it is not correct the caching engine will not load.
  19. Caching doesn’t work. The timestamp on my blog keeps changing when I reload. Check that the path in your .htaccess rules matches where the supercache directory is. You may have to hardcode it. Try disabling supercache mode.
  20. If supercache cache files are generated but not served, check the permissions on all your wp-content/cache/supercache folders (and each of wp-content cache and supercache folders) and wp-content/cache/.htaccess. If your PHP runs as a different user to Apache and permissions are strict Apache may not be able to read the PHP generated cache files. To fix you must add the following line to your wp-config.php (Add it above the WP_CACHE define.) Then clear your cache.

    umask( 0022 );
    
  21. If you see garbage in your browser after enabling compression in the plugin, compression may already be enabled in your web server. In Apache you must disable mod_deflate, or in PHP zlib compression may be enabled. You can disable that in three ways. If you have root access, edit your php.ini and find the zlib.output_compression setting and make sure it’s „Off“ or add this line to your .htaccess:

    php_flag zlib.output_compression off
    

    If that doesn’t work, add this line to your wp-config.php:

    ini_set('zlib.output_compression', 0);
    
  22. The „white screen of death“ or a blank page when you visit your site is almost always caused by a PHP error but it may also be caused by APC. Disable that PHP extension if you have trouble and replace with eAccelerator or Xcache.
  23. After uninstalling, your permalinks may break if you remove the WordPress mod_rewrite rules too. Regenerate those rules by visiting the Settings->Permalink page and saving that form again.
  24. If your blog refuses to load make sure your wp-config.php is correct. Are you missing an opening or closing PHP tag?
  25. Your front …

Installation

Install like any other plugin, directly from your plugins page but make sure you have custom permalinks enabled. Go to the plugin settings page at Settings->WP Super Cache and enable caching.

How to uninstall WP Super Cache

Almost all you have to do is deactivate the plugin on the plugins page. The plugin should clean up most of the files it created and modified, but it doesn’t as yet remove the mod_rewrite rules from the .htaccess file. Look for the section in that file marked by SuperCache BEGIN and END tags. The plugin doesn’t remove those because some people add the WordPress rules in that block too.

To manually uninstall:

  1. Turn off caching on the plugin settings page and clear the cache.
  2. Deactivate the plugin on the plugins page.
  3. Remove the WP_CACHE define from wp-config.php. It looks like define( 'WP_CACHE', true );
  4. Remove the Super Cache mod_rewrite rules from your .htaccess file.
  5. Remove the files wp-content/advanced-cache.php and wp-content/wp-cache-config.php
  6. Remove the directory wp-content/cache/
  7. Remove the directory wp-super-cache from your plugins directory.

If all else fails and your site is broken

  1. Remove the WP_CACHE define from wp-config.php. It looks like define( 'WP_CACHE', true );
  2. Remove the rules (see above) that the plugin wrote to the .htaccess file in your root directory.
  3. Delete the wp-super-cache folder in the plugins folder.
  4. Optionally delete advanced-cache.php, wp-cache-config.php and the cache folder in wp-content/.

FAQ

How do I know my blog is being cached?

Go to Settings -> WP Super Cache and look for the „Cache Tester“ form on the easy settings page. Click „Test Cache“ and the plugin will request the front page of the site twice, comparing a timestamp on each to make sure they match.

If you want to do it manually, enable debugging in the plugin settings page and load the log file in a new browser tab. Then view your blog while logged in and logged out. You should see activity in the log. View the source of any page on your site. When a page is first created, you’ll see the text „Dynamic page generated in XXXX seconds.“ and „Cached page generated by WP-Super-Cache on YYYY-MM-DD HH:MM:SS“ at the end of the source code. On reload, a cached page will show the same timestamp so wait a few seconds before checking.
If Supercaching is disabled and you have compression enabled, the text „Compression = gzip“ will be added. If compression is disabled and the page is served as a static html file, the text „super cache“ will be added. The only other way to check if your cached file was served by PHP script or from the static cache is by looking at the HTTP headers. PHP cached pages will have the header „WP-Super-Cache: Served supercache file from PHP“. WPCache cached files will have the header, „WP-Super-Cache: Served WPCache cache file“. You should also check your cache directory in wp-content/cache/supercache/hostname/ for static cache files.
If the plugin rules are missing from your .htaccess file, the plugin will attempt to serve the super cached page if it’s found. The header „WP-Super-Cache: Served supercache file from PHP“ if this happens.
The pagespeed module for Apache may cause problems when testing. Disable it if you notice any problems running the cache tester.

Wie kann ich Supercaching deaktivieren?

Wenn du nur die WP-Cache-Engine verwenden möchtest, bearbeite deine wp-config.php oder erstelle ein Mu-Plugin, das die Konstante ‚DISABLE_SUPERCACHE‘ auf 1 setzt.

WP-Cache vs. Supercache-Dateien

Alle Cache-Dateien werden in wp-content/cache/supercache/HOSTNAME/ gespeichert, wobei HOSTNANE dein Domain-Name ist. Die Dateien werden in Verzeichnissen gespeichert, die der Permalink-Struktur deiner Website entsprechen. Supercache-Dateien sind index.html oder eine Variante davon, je nachdem, welche Art von Besucher den Blog besucht hat. Andere Dateien heißen wp-cache-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.php. Die zugehörigen Metadateinamen beginnen mit „meta“. Diese Dateien enthalten Informationen über die gecachte Datei. Diese Dateien werden von der Engine „WPCache Caching“ im Plugin erzeugt.

Will comments and other dynamic parts of my blog update immediately?

Comments will show as soon as they are moderated, depending on the comment policy of the blog owner. Other dynamic elements on a page may not update unless they are written in Javascript, Flash, Java or another client side browser language. The plugin really produces static html pages. No PHP is executed when those pages are served. „Popularity Contest“ is one such plugin that will not work.

Will the Super Cache compression slow down my server?

No, it will do the opposite. 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, your server spends less time talking over the network which saves CPU time and bandwidth, and can also serve the next request much more quickly.

How do I make certain parts of the page stay dynamic?

Note: this functionality is disabled by default. You will have to enable it on the Advanced Settings page.

There are 2 ways of doing this. You can use Javascript to draw the part of the page you want to keep dynamic. That’s what Google Adsense and many widgets from external sites do and is the recommended way. Or you can use a WP Super Cache filter to do the job but you can’t use mod_rewrite mode caching. You have to use the „simple“ delivery method or disable supercaching.

WP Super Cache 1.4 introduced a cacheaction filter called wpsc_cachedata. The cached page to be displayed goes through this filter and allows modification of the page. If the page contains a placeholder tag the filter can be used to replace that tag with your dynamically generated html.
The function that hooks on to the wpsc_cachedata filter should be put in a file in the WP Super Cache plugins folder unless you use the late_init feature. An example plugin is included. Edit dynamic-cache-test.php to see the example code.
There are two example functions there. There’s a simple function that replaces a string (or tag) you define when the cached page is served. The other example function uses an output buffer to generate the dynamic content. Due to a limitation in how PHP works the output buffer code MUST run before the wpsc_cachedata filter is hit, at least for when a page is cached. It doesn’t matter when serving cached pages. See this post for a more technical and longer explanation.
To execute WordPress functions you must enable the ‚Late init‘ feature on the advanced settings page.

How do I delay serving the cache until the „init“ action fires?

Cached files are served before almost all of WordPress is loaded. While that’s great for performance it’s a pain when you want to extend the plugin using a core part of WordPress. Enable ‚Late init‘ mode on the Advanced settings page and cached files will be served when „init“ fires. WordPress and it’s plugins will be loaded now.

Why don’t WP UserOnline, Popularity Contest, WP Postratings or plugin X not work or update on my blog now?

This plugin caches entire pages but some plugins think they can run PHP code every time a page loads. To fix this, the plugin needs to use Javascript/AJAX methods or the wpsc_cachedata filter described in the previous answer to update or display dynamic information.

Why do my WP Super Cache plugins disappear when I upgrade the plugin?

WordPress löscht den Plugin-Ordner, wenn es ein Plugin aktualisiert. Dies gilt auch für den WP Super Cache, so dass alle geänderten Dateien im wp-super-cache/plugins/ gelöscht werden. Du kannst deine individuellen Plugins auf verschiedene Weise in ein anderes Verzeichnis verschieben. Du kannst die Variable $wp_cache_plugins_dir in wp-config.php oder wp-content/wp-cache-config.php definieren und auf ein Verzeichnis außerhalb des wp-super-cache Ordners zeigen lassen. Das Plugin wird dort nach seinen Plugins suchen. Oder wenn du ein Plugin verteilst, das früh geladen werden muss, kannst du die Funktion wpsc_add_plugin( $filename ) verwenden, um ein neues Plugin hinzuzufügen, wo immer es auch sein mag. Verwende den wpsc_delete_plugin( $filename ), um die Plugin-Datei zu entfernen. Siehe #574 oder diesen Beitrag zum Schreiben von WP Super Cache Plugins.

What does the Cache Rebuild feature do?

When a visitor leaves a comment the cached file for that page is deleted and the next visitor recreates the cached page. A page takes time to load so what happens if it receives 100 visitors during this time? There won’t be a cached page so WordPress will serve a fresh page for each user and the plugin will try to create a cached page for each of those 100 visitors causing a huge load on your server. This feature stops this happening. The cached page is not cleared when a comment is left. It is marked for rebuilding instead. The next visitor within the next 10 seconds will regenerate the cached page while the old page is served to the other 99 visitors. The page is eventually loaded by the first visitor and the cached page updated. See this post for more.

Why doesn’t the plugin cache requests by search engine bots by default?

Those bots usually only visit each page once and if the page is not popular there’s no point creating a cache file that will sit idle on your server. However you can allow these visits to be cached by removing the list of bots from „Rejected User Agents“ on the Advanced settings page.

A category page is showing instead of my homepage

A tiny proportion of websites will have problems with the following configuration:

  1. Uses a static page for the front page.
  2. Uses /%category%/%postname%/ permalink structure.

Manchmal wird eine Kategorieseite als Homepage der Website anstelle der statischen Seite zwischengespeichert. Ich kann das Problem nicht replizieren, aber eine einfache Lösung ist die Verwendung des „Simple“-Modus. Du kannst auch „Extra Homepage-Checks“ auf der Seite Erweiterte Einstellungen aktivieren.

Why do I get warnings about caching from http://ismyblogworking.com/

„Your blog doesn’t support client caching (no 304 response to If-modified-since).“
„Your feed doesn’t support caching (no 304 response to If-modified-since)“

Supercache doesn’t support 304 header checks in Expert mode but does support it in Simple mode. This is caching done by your browser, not the server. It is a check your browser does to ask the server if an updated version of the current page is available. If not, it doesn’t download the old version again. The page is still cached by your server, just not by your visitors‘ browsers.
Try the Cacheability Engine at http://www.ircache.net/cgi-bin/cacheability.py or https://redbot.org/ for further analysis.

How should I best use the utm_source tracking tools in Google Analytics with this plugin?

That tracking adds a query string to each url linked from various sources like Twitter and feedreaders. Unfortunately it stops pages being supercached. See Joost’s comment here for how to turn it into an anchor tag which can be supercached.

The plugin complains that wp-content is writable! htdocs is writable!

It’s not good when the web server can write to these directories but sometimes shared hosting accounts are set up in this way to make administration easier. Use chmod 755 directory to fix the permissions or find the permissions section of your ftp client. This Google search will lead you to more information on this topic and there’s also this codex page too. Unfortunately some hosts require that those directories be writable. If that’s the case just ignore this warning.

How do I delete the WP_CACHE define from wp-config.php?

Load your desktop ftp client and connect to your site. Navigate to the root (or the directory below it) of your site where you’ll find wp-config.php. Download that file and edit it in a text editor. Delete the line define( 'WP_CACHE', true ); and save the file. Now upload it, overwriting the wp-config.php on your server.

How do I delete the Super Cache rules from the .htaccess file?

Load your desktop ftp client and connect to your site. You may need to enable „Show hidden files“ in the preferences of the ftp client. Navigate to the root of your site where you’ll find the .htaccess file. Download that file and edit it in a text editor. Delete the lines between „# BEGIN WPSuperCache“ and „# END WPSuperCache“ and save the file. Now upload it, overwriting the .htaccess file on your server.

How do I change file permissions?

This page on the WordPress Codex explains everything you need to know about file permissions on your server and various ways of changing them.

Why do I get load spikes when new posts are made?

You may have the „clear all cached files when new posts are made“ option set. Clearing those files can take time plus your visitors will now be visiting uncached pages. Are you using Google Analytics campaign tracking with utm_source in the url? Those pages aren’t cached. See the question, „How should I best use the utm_source tracking tools in Google Analytics with this plugin“ above for how to use them properly.
Cached pages have to be refreshed when posts are made. Perhaps your server just isn’t up to the job of serving the amount of traffic you get. Enable the „cache rebuild“ feature as that may help.

How many pages can I cache?

The only real limit are limits defined by your server. For example, EXT2 and EXT3 allow a maximum of 31,999 sub directories so if you have a flat permalink structure (like /%POSTNAME%/) and more than 32,000 posts you may run into problems. Likewise, if you run a multisite network and have more than 31,999 sites (blogs) you won’t be able to cache all of them. Realistically if you had that many active sites you wouldn’t be running on one server.

Ich kann sehen, dass die www-Version meiner Website separat zwischengespeichert wird. Wie kann ich das verhindern?

WordPress sollte auf die kanonische URL deiner Website umleiten, aber wenn nicht, füge dies zu deiner .htaccess über den Supercache und WordPress Regeln hinzu. Änder example.com in deinen eigenen Hostnamen.
RewriteCond %{HTTP_HOST} www.example.com$[NC]
RewriteRule ^(.*)$ https://example.com/$1 [L,R=301]

How do I serve cached mobile pages to clients on small screens like phones and tablets?

Your theme is probably responsive which means it resizes the page to suit whatever device is displaying the page. If it’s not responsive, you’ll have to use a separate mobile plugin to render a page formatted for those visitors. The following plugins have been tested but YMMV depending on mobile client. You’ll have to enable mobile browser support as well on the Advanced settings page.

Rezensionen

7. Januar 2024 1 Antwort
Hello, the cache preload function works fine, after preload all pages it seems to delete the cache and start over. I want the cache to be cleared only on page and product updates. How can I solve this problem please help.
21. Dezember 2023 1 Antwort
I have used this plugin for ages and never had a problem. I cleaned a site up that had malware and it was fine. After reinstalling all plugins I get redirect malware which wants to redirect my users to a "catsndogz.org" site which is infected with a "botnet" malware. Thanks god I have anti virus software running on my pc. I uninstalled this plugin and ran the antivirus plugin on my wordpress site and malware is gone. Don't know if is this plugin but will investigate further but meanwhile please be aware.
7. November 2023 2 Antworten
Overall, it's a really great and simple to configure caching plugin. What I really like about WP Super Cache, is that it allows you to dive deeper and configure everything how you like. It even allows you to bypass the PHP request processing and just use .htaccess or nginx config rules to more efficiently cache & deliver content.
Alle 1.327 Rezensionen lesen

Mitwirkende & Entwickler

„WP Super Cache“ ist Open-Source-Software. Folgende Menschen haben an diesem Plugin mitgewirkt:

Mitwirkende

„WP Super Cache“ wurde in 31 Sprachen übersetzt. Danke an die Übersetzerinnen und Übersetzer für ihre Mitwirkung.

Übersetze „WP Super Cache“ in deine Sprache.

Interessiert an der Entwicklung?

Durchstöbere den Code, sieh dir das SVN Repository an oder abonniere das Entwicklungsprotokoll per RSS.

Änderungsprotokoll

1.12.0 – 2024-03-11

Added

  • Setup: Detect Jetpack Boost cache and suggest troubleshooting steps
  • WP Super Cache: added WPSC_PRELOAD_POST_INTERVAL and WPSC_PRELOAD_LOOP_INTERVAL to modify preload timings

Changed

  • Code Modernization: Replace usage of strpos() with str_contains()
  • Code Modernization: Replace usage of strpos() with str_starts_with().
  • Code Modernization: Replace usage of substr() with str_starts_with() and str_ends_with().
  • Fix blurry Automattic logo.
  • General: avoid deprecation warnings when trying to get URLs in PHP 8.2
  • General: indicate compatibility with the upcoming version of WordPress, 6.5.
  • General: updated PHP requirement to PHP 7.0+
  • General: update WordPress version requirements to WordPress 6.3.
  • WP Super Cache: check for Boost Cache when creating advanced-cache.php
  • WP Super Cache: fixed labels on advanced settings page
  • WP Super Cache: remove notifications that preload started working again.

Fixed

  • Supercache: add „days“ to „Next preload scheduled“ message.
  • Super Cache: with rebuild enabled, apply that to subdirectories instead of deleting them.
  • WP Super Cache – fix the wp_super_cache_clear_post_cache filter so the homepage cache isn’t deleted too.
  • WP Super Cache: bail if the request uri isn’t set. It means the plugin isn’t configured yet.
  • WP Super Cache: don’t create an output buffer if there’s already one active
  • WP Super Cache: fixed serving a cached page on POST with late init enabled.
  • WP Super Cache: fix the output buffer check, and make debug logs pre-formatted.
  • WP Super Cache: if the preload number of posts is not in the list, then add it

See the previous changelogs here