WP Super Cache

Descriere

Acest modul generează fișiere html statice din blogul tău dinamic WordPress. După ce un fișier html este generat, serverul tău web va servi acest fișier în loc de a procesa scripturi PHP din WordPress, care sunt comparativ mai greoaie și mai scumpe.

Fișierele html statice vor fi servite pentru marea majoritate a utilizatorilor, dar pentru că detaliile unui utilizator sunt afișate în formularul de comentariu după ce trimit un comentariu, acele solicitări sunt gestionate de către motorul moștenire cache. Fișierele statice sunt servite pentru:

  1. Utilizatorii care nu sunt autentificați.
  2. Utilizatorii care nu au lăsat un comentariu pe blogul tău.
  3. Sau utilizatorii care nu au văzut o parolă protejată pentru articol.

Vor fi servite fișiere html statice pentru 99% dintre vizitatorii tăi. Acei utilizatori care nu văd fișierele statice nu vor fi afectați, deoarece ei vor vedea diferite fișiere cache care nu sunt la fel de eficiente, dar mult mai bune decât cele nememorate în cache. Acest modul îți va ajuta serverul să facă față la aspectul paginii din față pentru digg.com sau alte situri de rețele sociale.

Dacă din oarecare motive „supercaching” nu funcționează pe serverul tău, nu-ți face griji. Cache își va face treaba în continuare, dar fiecare solicitare va necesita încărcarea motorului PHP. În condiții normale, acest lucru nu este rău deloc. Vizitatorii sitului tău nu vor observa nicio încetinire sau vreo diferență. Supercache iese într-adevăr în evidență în cazul în care serverul nu este destul de puternic sau te confruntați cu un trafic intens.
Fișierele html supercache vor fi servite mai rapid decât fișierele PHP generate prin cache, dar în utilizarea de zi cu zi, diferența nu este vizibilă.

Modulul servește fișierele cache în 3 moduri (clasificate în funcție de viteză):

  1. Mod_Rescriere. Cea mai rapidă metodă este de a folosi Apache mod_rewrite (sau orice altă extensie asemănătoare pe care serverul web o acceptă) pentru a servi fișiere html statice „supercached”. Acest mod ocolește complet PHP și este extrem de rapid. Dacă serverul tău este asaltat de un trafic imens, probabil va face față mai bine solicitărilor care sunt mai „ușoare”. Este nevoie de extensia Apache mod_rewrite (care probabil este instalată dacă ai legături permanente personalizate) și de o modificare a fișierului tău .htaccess. Utilizatorii anonimi sau necunoscuți care vizitează situl vor fi serviți în acest fel.
  2. PHP. Fișierele statice „supercached” pot fi acum servite de PHP. Modulul va servi un fișier „supercached”, dacă acesta există, această metodă fiind aproape la fel de rapidă ca metoda mod_rescriere. Este mai ușor de configurat pentru că fișierul .htaccess nu trebuie modificat. Însă ai nevoie de o legătură permanentă personalizată. Poți să-ți păstrezi porțiuni ale paginii dinamice prin acest mod de cache. Serverul tău ar putea să nu facă față la un trafic foarte mare. (Folosești Digg, nu-i așa? Vei avea nevoie de mod_rescriere, pentru restul dintre noi metoda PHP este OK!)
  3. Moștenire cache. Este folosit în principal la crearea paginilor cache pentru utilizatorii cunoscuți. Aceștia sunt utilizatori înregistrați, vizitatori care trimit comentarii sau cei care ar trebui să fie afișați cu date personalizate de utilizator. Este metoda cache cea mai flexibilă, dar totodată cea mai lentă. Așa cum fiecare pagină este diferită, de multe ori este mai bine să nu servești deloc pagini cache pentru acești utilizatori și să eviți metoda moștenire cache. De asemenea, dacă acest mod este selectat, va servi pagini cache pentru vizitele utilizatorilor necunoscuți. Totodată, pagina ta poate avea părți dinamice prin această metodă.

Dacă ești necunoscător cu privire la cache, utilizează modul PHP. Este ușor de configurat și foarte rapid. Evită moștenire cache dacă poți.

Setări recomandate

Utilizatorii avansați vor dori probabil să folosească metoda mod_rescriere, dar modul PHP este aproape la fel de bun și este recomandat pentru toți ceilalți. Activează următoarele:

  1. Mod PHP.
  2. Comprimă paginile.
  3. Nu servii pagini cache pentru utilizatorii cunoscuți.
  4. Reconstruiește cache.
  5. Suport CDN.
  6. Verificări suplimentare pentru prima pagină.

Colectarea gunoiului este actul de curățare a fișierelor cache care sunt expirate și vechi. Nu există nici o valoare corectă pentru timpul de expirare, dar un bun punct de plecare este 1800 de secunde, dacă nu utilizezi modul moștenire cache. Dacă folosești acest mod începe cu un timp de expirare de 600 de secunde.

Dacă nu utilizezi modul moștenire cache, ia în considerare să ștergi conținutul textului din caseta „Respins de agenții de utilizare” și permite motoarelor de căutare să creeze fișiere statice supercache.

De asemenea, preîncarcă cât de multe articole poți și activează „Modul preîncărcare”. Colectarea gunoiului se va face în continuare, dar nu va afecta fișierele preîncărcate. Dacă actualizarea pieselor din bara laterală nu se face des, setează intervalul de preîncărcare la 2880 de minute (2 zile) astfel încât toate articolele tale sa nu aibă un cache foarte des. Atunci când se face preîncărcarea, fișierele cache ale articolului împrospătat se șterg și apoi se regenerează. După aceea, se efectuează o colectare a gunoiului din toate fișierele vechi pentru a curăța fișierele cache.
Cu modul preîncărcare activat, fișierele cache vor fi șterse în continuare atunci când sunt publicate sau editate articole sau când se trimit comentarii.

Vezi prima pagină WP Super Cache pentru mai multe informații. De asemenea, este disponibilă documentația pentru dezvoltatori pentru cei care vor să interacționeze cu cache sau să scrie module.

Există, de asemenea, depozitarul GIT dacă vrei să contribui cu ceva.

Istoricul modificărilor este pagina unde poți afla ce sa schimbat de când ai descărcat modulul.

Ești interesat să traduci WP Super Cache în limba ta? Iată versiunea de dezvoltare unde vei găsi wp-super-cache.pot. Trimite fișierele cu traducere la donncha @ ocaoimh.ie. Mulțumesc!

Directorul cache, de obicei wp-content/cache/, este doar pentru fișierele temporare. Nu pune niciodată fișierele importante sau legături simbolice pentru fișiere importante sau alți directori în acest director. Acestea vor fi șterse dacă modulul are acces de scriere la ele.

Cum dezinstalez WP Super Cache

Aproape tot ceea ce trebuie să faci este să dezactivezi modulul pe pagina modulelor. Modul trebuie să curețe cele mai multe dintre fișierele pe care le-a creat și modificat, dar nu elimină încă regulile mod_rescriere din fișierul .htaccess. Caută în acest fișier secțiunea dintre SuperCache BEGIN și SuperCache END. Modulul nu elimină această secțiune pentru că unii adaugă regulile WordPress în acel bloc.

Pentru dezinstalarea manuală:

  1. Oprește cache din pagina de setări a modulului și golește memoria cache.
  2. Dezactivează modulul în pagina modulelor.
  3. Elimină definiția WP_CACHE din wp-config.php. Arată așa: define( 'WP_CACHE', true );
  4. Elimină regulile mod_rescriere Super Cache din fișierul tău .htaccess.
  5. Elimină fișierele wp-content/advanced-cache.php și wp-content/wp-cache-config.php
  6. Elimină directorul wp-content/cache/
  7. Elimină directorul wp-content/cache/ din directorul tău de module.

Dacă toate celelalte metode au eșuat și situl tău este nefuncțional

  1. Elimină definiția WP_CACHE din wp-config.php. Arată așa: define( 'WP_CACHE', true );
  2. Elimină regulile (vezi mai sus) pe care modulul le-a scris în fișierul .htaccess în directorul rădăcină.
  3. Șterge dosarul wp-super-cache din dosarul modulelor.
  4. Opțional, poți șterge advanced-cache.php, wp-cache-config.php și dosarul cache din wp-content/.

CDN

O rețea de livrare de conținut (Content Delivery Network – CDN) este de obicei o rețea de calculatoare situate în întreaga lume, care vor servi conținutul sitului tău mai repede, prin folosirea unor servere mai aproape de tine. Fișiere statice, cum ar fi imagini, JavaScript și fișiere CSS, pot fi servite prin intermediul acestor rețele în scopul de a accelera încărcarea sitului tău.

OSSDL CDN off-linker a fost integrat în WP Super Cache pentru a oferi sprijinul de bază pentru CDN. Acționează prin rescrierea URL-urilor fișierelor (cu excepția fișierelor .php) în wp-content și wp-include pe serverul tău, astfel încât acestea indică un alt nume de gazdă. Suportul pentru multe CDN-uri merge la origini. Acest lucru înseamnă că CDN va descărca fișierul în mod automat de pe serverul tău la prima solicitate și va continua să-l servească, pentru o durată de timp configurabilă, înainte de a-l descărca din nou de la server.

Configurează acestea în fila „CDN” din pagina de setări a modulului. Aceasta este o tehnică avansată și necesită înțelegerea modului de funcționare a serverul web sau a CDN. Te rog asigură-te că vei șterge fișierul cache după ce configurezi CDN.

Cache personalizat

Acum este posibil să te agăți în procesul cache folosind funcția add_cacheaction()

Trei agățători (cârlige) sunt disponibile:

  1. ‘wp_cache_get_cookies_values’ – modifică cheia folosită de WP Cache.
  2. ‘add_cacheaction’ – rulează în faza a 2-a. Permite unui modul să adauge agățători WordPress.
  3. ‘cache_admin_page’ – rulează în pagina de administrare. Se utilizează pentru a modifica pagina respectivă, cumva prin adăugarea unor noi opțiuni de configurare.

De asemenea, există un filtru obișnuit WordPress. Folosește filtrul „do_createsupercache”
pentru a personaliza verificările efectuate înainte de cache. Filtrul accepta un parametru.
Ieșirea funcției wp_cache_get_cookies_values() din WP-Cache.

Vezi module/searchengine.php ca un exemplu pe care îl folosesc pentru modulul No Adverts for Friends.

Legături

WP Widget Cache este un alt modul WordPress pentru cache. Acest modul crează fișiere cache pentru ieșirea pieselor și poate accelera în mod semnificativ timpii de generare a unei pagini dinamice.

Actualizări

Actualizările modulului vor fi publicate aici, la Holy Shmoly! și prima pagină WP Super Cache va avea întotdeauna o legătură pentru cea mai nouă versiune.

Mulțumesc

Aș dori să-i mulțumesc sincer lui John Pozadzides pentru că mi-a dat ideea asta, pentru secțiunea pe care a scris-o privind „Modul de funcționare” și pentru testarea modulului prin 2 apariții pe prima pagină pe digg.com

Mulțumesc James Farmer și Andrei Billits de la Edu Blogs că m-ați ajutat să fac acest WordPress MU mai prietenos.

Traducătorilor care au făcut o treabă bună prin conversia textului modulului în limba lor maternă. Mulțumesc!

Instalare

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.

Întrebări frecvente

Cum știu dacă blogul meu servește fișiere cache?

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.
In legacy caching mode, if 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”. Legacy cached files will have the header, „WP-Super-Cache: Served legacy cache file”. I used the Live HTTP Headers extension for Firefox to examine the headers. 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.

Moștenire (WP-Cache) vs fișiere Supercache

WP-Cache files are stored in wp-content/cache/ (or on MU sites in a blogs sub directory) and are named wp-cache-XXXXXXXXXXXXXXXXX.html. Associated meta files are stored in a meta sub directory. Those files contain information about the cached file. These files are generated by the „legacy caching” code in the plugin.
Supercache files are stored in wp-content/cache/supercache/HOSTNAME/ where HOSTNAME is your domain name. The files are stored in directories matching your site’s permalink structure.

Comentariile și alte părți dinamice ale blogului meu se vor actualiza imediat?

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.

Compresia Super Cache îmi va încetini serverul?

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.

Cum pot face ca anumite părți ale paginii să rămână dinamice?

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 switch to PHP or legacy caching.

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.

Cum pot să întârzii servirea de fișiere cache până când acțiunea „init” se declanșează?

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.

De ce modulele WP UserOnline, Popularity Contest, WP Postratings sau un oarecare modul X nu funcționează sau nu se actualizează pe blogul meu acum?

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.

De ce modulul meu WP Super Cache dispare atunci când actualizez modulul?

WordPress deletes the plugin folder when it updates a plugin. This is the same with WP Super Cache so any modified files in wp-super-cache/plugins/ will be deleted. You can define the variable $wp_cache_plugins_dir in wp-config.php or wp-content/wp-cache-config.php and point it at a directory outside of the wp-super-cache folder. The plugin will look there for it’s plugins.

Ce face funcționalitatea Reconstruire cache?

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.

De ce nu se creează implicit solicitările cache ale modulului de către roboții motoarelor de căutare?

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 if you’re not using legacy caching you can allow these visits to be cached by removing the list of bots from „Rejected User Agents” on the Advanced settings page.

Este afișată o pagină de categorie în loc de prima mea pagină

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.

Sometimes a category page is cached as the homepage of the site instead of the static page. I can’t replicate the problem but a simple solution is to switch the plugin to PHP mode. For normal traffic you will see no difference in the speed of your site. You can also enable „Extra homepage checks” on the Advanced Settings page.

De ce primesc avertismente de la http://ismyblogworking.com/ referitoare la cache

„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 mod_rewrite mode but does support it in PHP 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 http://redbot.org/ for further analysis.

Cum aș poate utiliza cel mai bine instrumentele de urmărire utm_source în Google Analytics cu ajutorul acestui modul?

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.

Modulul se plânge că wp-content este editabil! htdocs este editabil!

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.

Cum să șterg definiția WP_CACHE din 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.

Cum să șterg regulile Super Cache din fișierul .htaccess?

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.

Cum pot schimba permisiunile fișierului?

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

De ce primesc vârfuri de încărcare atunci când sunt publicate articole noi?

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.

Cât de multe pagini cache pot fi servite?

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.

Cum pot servi pagini mobile cache clienților care folosesc ecrane mici, cum ar telefoane și tablete?

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.

Depanare

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 myhostname.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. Or use the plugin in PHP or legacy caching 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 page is ok but posts and pages give a 404? Go to Settings->permalinks and click „Save” once you’ve selected a custom permalink structure. You may need to manually update your .htaccess file.
  26. If certain characters do not appear correctly on your website your server may not be configured correctly. You need to tell visitors what character set is used. Go to Settings->Reading and copy the ‘Encoding for pages and feeds’ value. Edit the .htaccess file with all your Supercache and WordPress rewrite rules and add this at the top, replacing CHARSET with the copied value. (for example, ‘UTF-8’)

    AddDefaultCharset CHARSET
    
  27. Use Cron View to help diagnose garbage collection and preload problems. Use the plugin to make sure jobs are scheduled and for what time. Look for the wp_cache_gc and wp_cache_full_preload_hook jobs.
  28. The error message, „WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory.” appears at the end of every page. You can delete wp-content/advanced-cache.php and reload the plugin settings page or edit wp-config.php and look for WPCACHEHOME and make sure it points at the wp-super-cache folder. This will normally be wp-content/plugins/wp-super-cache/ but you’ll likely need the full path to that file (so it’s easier to let the settings page fix it). If it is not correct the caching engine will not load.
  29. If your server is running into trouble because of the number of semaphores used by the plugin it’s because your users are using file locking which is not recommended (but is needed by a small number of users). You can globally disable file locking by defining the constant WPSC_DISABLE_LOCKING, or defining the constant WPSC_REMOVE_SEMAPHORE so that sem_remove() is called after every page is cached but that seems to cause problems for other processes requesting the same semaphore. Best to disable it.

Verificări

Blazin Fast!

Caching static HTML files, the site is going super fast. This enables the speed of GravCMS but with the power of WordPress. Yeah buddy!

Perfect but Custom Css does not work in new Version 1.4.x

I love this Plugin but would be awesome if you can fix that when I activate this Plugin Custom CSS is not working anymore!

Tested Plugins ( not working but perviusly worked )
– WP Add Custom CSS https://de.wordpress.org/plugins/wp-add-custom-css/
– Simple Custom CSS https://de.wordpress.org/plugins/simple-custom-css/

Tested Plugin ( even now working! )
– Custom CSS Pro https://de.wordpress.org/plugins/custom-css-pro/
– Laborator Custom Css This Plugin/Extension is from Codemirro (I guess) and it’s build in in every Laboratory Theme

But this Plugin was updated 9 month ago so I think its your Plugin which made the change which is not including Custom Css anymore

If I deactivate WP Super Cache ALL of the Custom Css Plugins are affecting my Site

As I said: I’m not sure which of these Plugins made the Change that Custom CSS is not affecting the Page when WP Super Cache is activated but I think its WP Super Cache itself

Pls notify me when you know something about this Bug

Much improved performance

I have several WP sites that are small with static content. I used WP Super Cache to preload pages for these sites and the load time on pages was dramatically better. The setup was simple, although I did not take the time to investigate all the options. This is something I will do now to see what I am missing. But, just choosing recommended options improved my site noticeably.

Citește toate cele 1.204 recenzii

Contributori și dezvoltatori

„WP Super Cache” este un software open source. Următoarele persoane au contribuit la acest modul.

Contributori

“WP Super Cache” has been translated into these 12 locales: Japanese, Russian, Croatian, Persian, Chinese (China), Italian, Chilean Spanish, Romanian, English (UK), English (Canada), English (Australia), English (New Zealand). Mulțumim traducătorilor pentru contribuția lor.

Tradu „WP Super Cache” în limba ta.

Te interesează dezvoltarea?

Răsfoiește codul sau abonează-te la jurnalul de dezvoltare prin RSS.

Istoric modificări

1.4.9

  • Fixed bug when not running sem_remove after sem_release. See https://github.com/Automattic/wp-super-cache/issues/85
  • Fixed a PHP error impacting PHP 7.1.
  • Fixed a bug where we cached PUT and DELETE requests. We’re treating them like POST requests now.
  • Delete supercache cache files, even when supercache is disabled, because mod_rewrite rules might still be active.
  • Updated the settings page, moving things around. #173
  • Make file locking less attractive on the settings page and fixed the WPSC_DISABLE_LOCKING constant so it really disables file locking even if the user has enabled it already.
  • Added a WPSC_REMOVE_SEMAPHORE constant that must be defined if sem_remove() is to be used as it may cause problems. #174
  • Added a „wpsc_delete_related_pages_on_edit” filter that on returning 0 will disable deletion of pages outside of page being edited. #175
  • Fixed plugin deleting all cached pages when a site had a static homepage. #175
  • Make sure $cache_path has a trailing slash #177
  • Remove flush() #127 but also check if headers are empty and flush and get headers again. #179
  • Add fix for customizer #161 and don’t cache PUT AND DELETE requests #178
  • Check for superglobals before using them. #131

1.4.8

  • Removed malware URL in a code comment. (harmless to operation of plugin but gets flagged by A/V software)
  • Updated translation file.

1.4.7

  • Update the settings page for WordPress 4.4. layout changes.

1.4.6

  • Generate the file cache/.htaccess even when one exists so gzip rules are created and gzipped pages are served correctly. Props Tigertech. https://wordpress.org/support/topic/all-website-pages-downloading-gz-file-after-latest-update?replies=36#post-7494087

1.4.5

  • Enhancement: Only preload public post types. Props webaware.
  • Added an uninstall function that deletes the config file. Deactivate function doesn’t delete it any more.
  • Possible to deactivate the plugin without visiting the settings page now.
  • Fixed the cache rebuild system. Rebuild files now survive longer than the request that generate them.
  • Minor optimisations: prune_super_cache() exits immediately if the file doesn’t exist. The output of wp_cache_get_cookies_values() is now cached.
  • Added PHP pid to the debug log to aid debugging.
  • Various small bug fixes.
  • Fixed reset of expiry time and GC settings when updating advanced settings.
  • Removed CacheMeta class to avoid APC errors. It’s not used any more.
  • Fixed reset of advanced settings when using „easy” settings page.
  • Fixed XSS in settings page.
  • Hide cache files when servers display directory indexes.
  • Prevent PHP object injection through use of serialize().

1.4.4

  • Fixed fatal error in output handler if GET parameters present in query. Props webaware.
  • Fixed debug log. It wasn’t logging the right message.

1.4.3

  • Security release fixing an XSS bug in the settings page. Props Marc Montpas from Sucuri.
  • Added wp_debug_log(). Props Jen Heilemann.
  • Minor fixes.

1.4.2

  • Fixed „acceptable file list”.
  • Fixed „Don’t cache GET requests” feature.
  • Maybe fixed „304 not modified” problem for some users.
  • Fixed some PHP warnings.

1.4.1

  • Fixed XSS in settings page. Props Simon Waters, Surevine Limited.
  • Fix to object cache so entries may now be deleted when posts updated. (object cache still experimental)
  • Actualizări pentru documentație și curățarea paginii pentru setări.

1.4

  • Replace legacy mfunc/mnclude/dynamic-cached-content functionality with a „wpsc_cachedata” cacheaction filter.
  • Added dynamic-cache-test.php plugin example wpsc_cachedata filter plugin.
  • Delete post, tag and category cache when a post changes from draft to publish or vice versa. Props @Biranit.
  • Update advanced-cache.php and wp-config.php if wp-cache-phase1.php doesn’t load, usually happening after migrating to a new hosting service.
  • Misc bugfixes.

1.3.2

  • Any mfunc/mclude/dynamic-cached-content tags in comments are now removed.
  • Dynamic cached content feature disabled by default and must be enabled on the Advanced Settings page.
  • Support for the mobile theme in Jetpack via helper plugin on script’s Plugins tab.

1.3.1

  • Minor updates to documentation
  • Fixed XSS in settings page.

1.3

  • mfunc tags could be executed in comments. Fixed.
  • More support for sites that use the LOGGED_IN_COOKIE constant and custom cookies.

1.2

  • Garbage collection of old cache files is significantly improved. I added a scheduled job that keeps an eye on things and restarts the job if necessary. Also, if you enable caching from the Easy page garbage collection will be enabled too.
  • Editors can delete single cached files from the admin bar now.
  • Fixed the cached page counter on the settings page.
  • Some sites that updated to 1.0 experienced too much garbage collection. There are still stragglers out there who haven’t upgraded but that’s fixed now!
  • Supercached mobile files are now used as there was a tiny little typo that needed fixing.
  • If your site is in a directory and you saw problems updating a page then that should be fixed now.
  • The deactivate hook has been changed so your configuration isn.t hosed when you upgrade. Unfortunately this will only happen after you do this upgrade.
  • Some sites use custom cookies with the LOGGED_IN_COOKIE constant. Added support for that.
  • Added support for WPTouch Pro, but it appears to be flaky still. Anyone have time to work on that? I don.t.
  • Some sites had problems with scheduled posts. For some reason the plugin thought the post was in draft mode and then because it only checked the same post once, when the post magically became published the cache wasn.t cleared. That.s fixed, thanks to the debug logging of several patient users.
  • And more bug fixes and translation updates.

1.1

  • Use $_SERVER[ ‘SERVER_NAME’ ] to create cache directories.
  • Only create blogs cached directories if valid requests and blogs exist.
  • Only clear current blog’s cache files if navigation menu is modified
  • Added clean_post_cache action to clear cache on post actions
  • Removed garbage collection details on Contents tab
  • Added wp_cache_check_mobile cacheaction filter to shortcircuit mobile device check.
  • Don’t delete cache files for draft posts
  • Added action on wp_trash_post to clear the cache when trashed posts are deleted
  • Show a warning when 304 browser caching is disabled (because mod_rewrite caching is on)
  • New check for safe mode if using less that PHP 5.3.0
  • Added wp_supercache_remove_cookies filter to disable anonymous browsing mode.
  • Fixed garbage collection schedule dropdown
  • Fixed preload problem clearing site’s cache on „page on front” sites.
  • Fix for PHP variable not defined warnings
  • Fixed problem refreshing cache when comments made as siteurl() sometimes didn’t work
  • Preloading of taxonomies is now optional
  • Domain mapping fixes.
  • Better support for https sites. Remove https:// to get cache paths.
  • Added AddDefaultCharset .htaccess rule back in and added an option to remove it if required.
  • Added multisite plugin that adds a „Cached” column to Network->Sites to disable caching on a per site basis.
  • Added WPTouch plugin to modify browser and prefix list in mobile detection code. Added support for that plugin’s exclude list.
  • Fixed cache tester
  • Filter the tags that are used to detect end-of-page using the wp_cache_eof_tags filter.
  • Removed debug level from logging as it wasn’t helpful.
  • Removed mention of wp-minify.

1.0

  • Removed AddDefaultCharset .htaccess rule
  • Fixed problem with blogs in a folder and don’t have a trailing slash
  • New scheduling of garbage collection
  • Added a „Delete cache” link to admin bar to delete cache of current page.
  • Updated documentation
  • Sorry Digg, Stephen Fry power now!
  • Updated translations
  • Preload taxonomies and all post types except revisionsand nav menu items
  • Fixed previews by logged in users.
  • Added option to make logged in users anonymous
  • Use WP 3.0 variables to detect multisite installs
  • Hash filenames so files are served from the same CDNs

0.9.9.9

  • Fixed typo, is_front_page.
  • Serve repeated static files from the same CDN hostname.
  • Updated translations.
  • Make supercache dir lowercase to avoid problems with unicode URLs.
  • Add option to skip https loaded static content.
  • Remove 5 second check on age of existing cache files. Should help with posts that get lots of comments and traffic.
  • Lots of bugs fixed.

0.9.9.8

  • CDN updates: can be switched off, multiple CNAMEs.
  • Uninstall process improved. It removes generated files and fixes edited files.
  • Cached dynamic pages can now be stored in Supercache files and compressed.
  • 1and1 Webhosting fix (/kunden/)
  • Remove log by email functionality as it caused problems for users who were inundated by email
  • Many more minor fixes and changes.

0.9.9.6

  • Fixed problem serving cached files with PHP
  • Added support for 304 „file not modified” header to help browser caching. (PHP caching only)
  • Added French & German translations, updated Italian translation and fixed translation strings.
  • Sleep 4 seconds between preload urls to reduce load on the server
  • Updated docs and FAQs.

0.9.9.5

  • Disable compression on on easy setup page. Still causes problems on some hosts.
  • Remove footerlink on easy setup page.
  • Don’t delete mod_rewrite rules when caching is disabled.
  • Don’t stop users using settings page when in safe mode.

0.9.9.4

  • Settings page split into tabbed pages.
  • Added new „Easy” settings page for new users.
  • New PHP caching mode to serve supercached files.
  • Mobile support fixes.
  • Added Domain mapping support plugin.
  • Added „awaiting moderation” plugin that removes that text from posts.
  • Terminology change. Changed „half on” to „legacy caching”.
  • Fixed cache tester on some installs of WordPress.
  • Updated documentation
  • Added $wp_super_cache_lock_down config variable to hide lockdown and directly cached pages admin items.
  • Preloaded checks if it has stalled and reschedules the job to continue.
  • Serve the gzipped page when first cached if the client supports compression.
  • Lots more bug fixes..

0.9.9.3

  • Fixed division by zero error in half on mode.
  • Always show „delete cache” button.
  • Fixed „Update mod_rewrite rules” button.
  • Minor text changes to admin page.

0.9.9.2

  • Forgot to change version number in wp-cache.php

0.9.9.1

  • Added preloading of static cache.
  • Better mobile plugin support
  • .htaccess rules can be updated now. Added wpsc_update_htaccess().
  • Fixed „page on front” cache clearing bug.
  • Check for wordpress_logged_in cookie so test cookie isn’t detected.
  • Added clear_post_supercache() to clear supercache for a single post.
  • Put quotes around rewrite rules in case paths have spaces.

0.9.9

  • Added experimental object cache support.
  • Added Chinese(Traditional) translation by Pseric.
  • Added FAQ on WP-Cache vs Supercache files.
  • Use Supercache file if WP-Cache file not found. Useful if mod_rewrite rules are broken or not working.
  • Get mobile browser list from WP Mobile Edition if found. Warn user if .htaccess out of date.
  • Make sure writer lock is unlocked after writing cache files.
  • Added link to developer docs in readme.
  • Added Ukranian translation by Vitaly Mylo.
  • Added Upgrade Notice section to readme.
  • Warn if zlib compression in PHP is enabled.
  • Added compression troubleshooting answer. Props Vladimir (http://blog.sjinks.pro/)
  • Added Japanese translation by Tai (http://tekapo.com/)
  • Updated Italian translation.
  • Link to WP Mobile Edition from admin page for mobile support.

0.9.8

  • Added Spanish translation by Omi.
  • Added Italian translation by Gianni Diurno.
  • Addded advanced debug code to check front page for category problem. Enable by setting $wp_super_cache_advanced_debug to 1 in the config file.
  • Fixed wordpress vs wordpress_logged_in cookie mismatch in cookie checking function.
  • Correctly check if WP_CACHE is set or not. PHP is weird.
  • Added wp_cache_clear_cache() to clear out cache directory.
  • Only show logged in message when debugging enabled.
  • Added troubleshooting point 20. PHP vs Apache user.
  • Fixed problem deleting cache file.
  • Don’t delete cache files when moderated comments are deleted.

0.9.7

  • Fixed problem with blogs in folders.
  • Added cache file listing and delete links to admin page.
  • Added „Newest Cached Pages” listing in sidebox.
  • Made admin page translatable.
  • Added „How do I make certain parts of the page stay dynamic?” to FAQ.
  • Advanced: added „late init” feature so that plugin activates on „init”. Set $wp_super_cache_late_init to true in config file to use.
  • Disable supercaching when GET parameters present instead of disabling all caching. Disable on POST (as normal) and preview.
  • Fixed problem with cron job and mutex filename.
  • Warn users they must enable mobile device support if rewrite rules detected. Better detection of when to warn that .htaccess rules must be updated (no need when rewrite rules not present)
  • Advanced: Added „wpsupercache_404” filter. Return true to cache 404 error pages.
  • Use the wordpress_test_cookie in the cache key.
  • Show correct number of cache files when compression off.
  • Fixed problem with PHP safe_mode detection.
  • Various bugfixes and documentation updates. See Changelog.txt

0.9.6.1

  • Move „not logged in” message init below check for POST.
  • Add is_admin() check so plugin definitely can’t cache the backend.
  • Add „do not cache” page type to admin page.

0.9.6

  • Add uninstall.php uninstall script.
  • Updated cache/.htaccess rules (option to upgrade that)
  • Added FAQ about category and static homepage problem.
  • Add wp_cache_user_agent_is_rejected() back to wp-cache-phase2.php
  • Show message for logged in users when caching disable for them.
  • Check filemtime on correct supercache file

0.9.5

  • Show next and last GC times in minutes, not local time.
  • Don’t serve wp_cache cache files to rejected user agents. Supercache files are still served to them.
  • If enabled, mobile support now serves php cached files to mobile clients and static cached files to everyone else.
  • Added checks for „WPSC_DISABLE_COMPRESSION” and „WPSC_DISABLE_LOCKING” constants to disable compression and file locking. For hosting companies primarily.
  • Added check for DONOTCACHEPAGE constant to avoid caching a page.
  • Use PHP_DOCUMENT_ROOT when creating .htaccess if necessary.

0.9.4.3

  1. Added „Don’t cache for logged in users” option.
  2. Display file size stats on admin page.
  3. Clear the cache when profile page is updated.
  4. Don’t cache post previews.
  5. Added backslashes to rejected URI regex list.
  6. Fixed problems with posts and comments not refreshing.