Title: Background problem
Last modified: February 2, 2017

---

# Background problem

 *  [gottfrieds](https://wordpress.org/support/users/gottfrieds/)
 * (@gottfrieds)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/background-problem-8/)
 * Ich habe einen Zufallshintergrund auf der Startseite und im Blog. Dieser wird
   in Edge auch angezeigt. In Chrome bleibt er statisch, auch nach dem Leeren des
   Chaches. Opera reagiert wie Chrome. In Firefox ändert sich das Bild nur bei Refresh.
 * Das ist meine [Site](http://huppenbroich.de).
 * Als .htacess verwende ich:
 *     ```
       # BEGINN CACHIFY
   
           # ENGINE ON
           RewriteEngine On
   
           # GZIP FILE
   
               RewriteCond %{REQUEST_URI} /$
               RewriteCond %{REQUEST_URI} !^/wp-admin/.*
               RewriteCond %{REQUEST_METHOD} !=POST
               RewriteCond %{QUERY_STRING} =""
               RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_
               RewriteCond %{HTTP:Accept-Encoding} gzip
               RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/cachify/%{HTTP_HOST}%{REQUEST_URI}index.html.gz -f
               RewriteRule ^(.*) /wp-content/cache/cachify/%{HTTP_HOST}%{REQUEST_URI}index.html.gz [L]
   
               AddType text/html .gz
               AddEncoding gzip .gz
   
   
           # HTML FILE
           RewriteCond %{REQUEST_URI} /$
           RewriteCond %{REQUEST_URI} !^/wp-admin/.*
           RewriteCond %{REQUEST_METHOD} !=POST
           RewriteCond %{QUERY_STRING} =""
           RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_
           RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/cachify/%{HTTP_HOST}%{REQUEST_URI}index.html -f
           RewriteRule ^(.*) /wp-content/cache/cachify/%{HTTP_HOST}%{REQUEST_URI}index.html [L]
   
       # END CACHIFY
   
       # BEGINN WordPress
   
       RewriteEngine On
       RewriteRule ^sitemap\.xml$ /sitemap.xml.php [L]
       RewriteRule ^robots\.txt$ /robots.txt.php [L]
       # BEGIN WordPress
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
       RewriteRule ^index\.php$ - [L]
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
       </IfModule>
   
       # END WordPress
       ```
   
 * Der cache ist mit 650 KB gefüllt, aber die Datei /wp-content/cache ist leer.
 * Welchen Fehler mache ich???
    -  This topic was modified 9 years, 4 months ago by [gottfrieds](https://wordpress.org/support/users/gottfrieds/).
    -  This topic was modified 9 years, 4 months ago by [gottfrieds](https://wordpress.org/support/users/gottfrieds/).

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Support [Torsten Landsiedel](https://wordpress.org/support/users/zodiac1978/)
 * (@zodiac1978)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/background-problem-8/#post-8728777)
 * Bei welchem Hoster bist Du?
 * Gruß, Torsten
 *  [websupporter](https://wordpress.org/support/users/websupporter/)
 * (@websupporter)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/background-problem-8/#post-8728821)
 * Hi gottfrieds,
    das sieht mir erst einmal nicht nach einem Problem mit Cachify
   aus. Ich habe es schnell mal in Firefox und Chrome getestet und die Bilder wechseln
   bei beiden, wenn ich die Seiten neu lade.
 * Da du auf eine PHP-Datei verweist, welche das Bild nach Zufallsprinzip ausgibt
   und es so aussieht, dass diese PHP-Datei auch nicht weiter ins WordPress System
   eingebunden ist, ist mein erster Eindruck, dass Cachify hier auch gar nicht erst
   ins Spiel kommt.
 * Wenn ich es richtig sehe leitet die PHP-Datei aber weiter auf das Bild. Wenn 
   man in die Antwort des Servers schaut gibt die PHP-Datei scheinbar das Bild aus,
   hat aber auch im Header ein `Location ./sonstige--0310.jpeg`. Vielleicht muss
   man sich über das Script noch einmal Gedanken machen.
 * Ist aber nur mein vorläufiger Eindruck. Aber vielleicht hilft das ja schon weiter.
 *  Thread Starter [gottfrieds](https://wordpress.org/support/users/gottfrieds/)
 * (@gottfrieds)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/background-problem-8/#post-8728947)
 * Strato ist mein Hoster!
 *  Thread Starter [gottfrieds](https://wordpress.org/support/users/gottfrieds/)
 * (@gottfrieds)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/background-problem-8/#post-8728977)
 * Das ist die PHP-Funktion – ggfs. ist die das Übel:
 *     ```
       <?php
       /*
       By Matt Mullenweg > http://photomatt.net
       Inspired by Dan Benjamin > http://hiveware.com/imagerotator.php
       Latest version always at:
       http://photomatt.net/scripts/randomimage
       */// Make this the relative path to the images, like "../img" or "random/images/".
       // If the images are in the same directory, leave it blank.
       $folder = '';
   
       // Space seperated list of extensions, you probably won't have to change this.
       $exts = 'jpg jpeg png gif';
   
       $files = array(); $i = -1; // Initialize some variables
       if ('' == $folder) $folder = './';
   
       $handle = opendir($folder);
       $exts = explode(' ', $exts);
       while (false !== ($file = readdir($handle))) {
       foreach($exts as $ext) { // for each extension check the extension
       if (preg_match('/\.'.$ext.'$/i', $file, $test)) { // faster than ereg, case insensitive
       $files[] = $file; // it's good
       ++$i;
       }
       }
       }
       closedir($handle); // We're not using it anymore
       mt_srand((double)microtime()*1000000); // seed for PHP < 4.2
       $rand = mt_rand(0, $i); // $i was incremented as we went along
   
       header('Location: '.$folder.$files[$rand]); // Voila!
       ?>
       ```
   
 * In anderen Sites arbeitet die aber einwandfrei.
 *  Plugin Support [Torsten Landsiedel](https://wordpress.org/support/users/zodiac1978/)
 * (@zodiac1978)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/background-problem-8/#post-8729020)
 * Ich dachte erst, es handelt sich um ein Problem mit dem %{DOCUMENT_ROOT}. Diese
   Variable ist z.B. bei Domainfactory nicht gesetzt. Aber du benutzt die DB-Caching-
   Methode, oder? Der in der Website angezeigte Text sagt das zumindest aus.
 * > <!–
   >  Cachify | [http://cachify.de](http://cachify.de) Ohne Plugin: 103 DB-Anfragen,
   > 1,91 Sekunden, 11,67 MB Mit Plugin: 35 DB-Anfragen, 0,40 Sekunden, 9,33 MB 
   > Generiert: 42 Minuten zuvor –>
 * Der angebenen Ordner `/wp-content/cache` (bzw. sein Unterordner `/cachify`) wird
   nur bei der HDD-Caching-Methode befüllt. Auch die `.htaccess`-Regel wird nur 
   in diesem Fall benötigt.
 * Das Problem hat aber wahrscheinlich gar nichts mit Cachify zu tun. Die Website
   enthält diverse Fehler. Der gröbste ist, dass dein Hintergrundbild im `<head>`-
   Bereich ausgegeben wird, wo es nicht hingehört.
 * Daneben existieren noch weitere Fehler, wie z.B. die fehlende Anonymisierung 
   der IP-Adresse bei Google Analytics. Das ist aber leicht in dem genutzten Plugin
   zu aktivieren. Das solltest du zeitnah machen, da ein Verstoß abmahnfähig ist.
 * Gruß, Torsten
    -  This reply was modified 9 years, 4 months ago by [Torsten Landsiedel](https://wordpress.org/support/users/zodiac1978/).
 *  Thread Starter [gottfrieds](https://wordpress.org/support/users/gottfrieds/)
 * (@gottfrieds)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/background-problem-8/#post-8729357)
 * Vielen Dank für Deinen Hinweis, Torsten.
 * Bis auf Firefox läuft jetzt wohl alles – incl. IP-Anonnymisierung.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Background problem’ is closed to new replies.

 * ![](https://ps.w.org/cachify/assets/icon-256x256.png?rev=2505413)
 * [Cachify](https://wordpress.org/plugins/cachify/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cachify/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cachify/)
 * [Active Topics](https://wordpress.org/support/plugin/cachify/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cachify/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cachify/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [gottfrieds](https://wordpress.org/support/users/gottfrieds/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/background-problem-8/#post-8729357)
 * Status: not resolved