Forums

[Plugin: WP Super Cache] Only caching feeds, not regular pages (16 posts)

  1. aschweigert
    Member
    Posted 1 month ago #

    Installed wp-super-cache and it seems to be working fine, except that it is only caching feeds and not content pages (that is, the content pages, but with urls ending in /feed/).

    Any idea what might be causing this?

    I checked the .htaccess files and everything looks to be in order. Any other places I should be looking?

    Thanks for your help.

  2. donncha
    Member
    Posted 1 month ago #

    Have you tried half-on mode? Does that help?

    Is your blog installed in a sub-directory?

  3. aschweigert
    Member
    Posted 1 month ago #

    Thanks donncha - just switched to half-on mode, i'll see if that makes a difference and let you know. It isn't installed in a subdirectory, so I don't think that's likely to be the issue.

  4. ensignkid
    Member
    Posted 1 month ago #

    I'm having the same issue with http://mmaopinion.com

    Super-cache won't work and regular caching is just URL's ending in /feed/...I have a decent number of visitors, so people are viewing the site.

    I'm confused too.

  5. donncha
    Member
    Posted 1 month ago #

    ensignkid - have you updated the .htaccess rules? Delete them between the SuperCache BEGIN and END tags, then reload the admin page and look for the mod_rewrite rules section. There's a button there to add them again.

    Your blog is setting the wordpress_test_cookie cookie and the old rules exclude browsers with that set. Use the debug logging functions too.

  6. aschweigert
    Member
    Posted 1 month ago #

    tried the half-on mode, same problem. Here is what the .htaccess contains...let me know what you think. This site is on dreamhost, ensignkid, what host are you using?

    # BEGIN WPSuperCache
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    AddDefaultCharset UTF-8
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP_USER_AGENT} !^.*(Android|2.0\ MMP|240x320|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|hiptop|IEMobile|iPhone|iPod|KYOCERA/WX310K|LG/U990|MIDP-2.0|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|Playstation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|Windows\ CE|WinWAP).*
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L]

    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP_USER_AGENT} !^.*(Android|2.0\ MMP|240x320|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|hiptop|IEMobile|iPhone|iPod|KYOCERA/WX310K|LG/U990|MIDP-2.0|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|Playstation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|Windows\ CE|WinWAP).*
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L]
    </IfModule>
    # END WPSuperCache

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

  7. donncha
    Member
    Posted 1 month ago #

    Have you tried the debug settings? That will tell you a *lot* about why a page isn't being cached. Limit it to your own IP and crank up the debug level to 5. Then visit your blog and examine the log file.

  8. twodboy
    Member
    Posted 1 month ago #

    Hi Donncha, same problem here - anything ending in /feed/ appears to cache ok, but normal pages are not cached at all. My wordpress installation IS in a sub-directory, with the index.php just above, in the site's root:

    Site is:
    http://2dboy.com

    wordpress is secretly here:
    http://2dboy.com/blog/

    The .htaccess files have been written, etc. Does WP Super Cache not work if the blog is in a sub-directory?

  9. donncha
    Member
    Posted 1 month ago #

    twodboy - it should work. Can you paste your WPSuperCache rules here? Are cache files created? I presume they're created in blog/wp-content/cache/ ?

    Have you tried half-on mode? Feeds are not cached by supercache static files but by "half on" cache files which leads me to think it's the rewrite rules.

    btw - I'm a big fan of "World of Goo", love that my purchase bought the Mac *and* Linux versions.

  10. twodboy
    Member
    Posted 1 month ago #

    Thanks! And looks like we got slashdotted a couple hours ago! I'll paste the rewrite rules below. Half-on mode doesn't appear to change anything - still just the feeds being cached.

    There are a bunch of wp-cache-*.html files in /blog/wp-content/cache/ as well as a ./blogs/ and ./meta/ directories, but I do not see a ./supercache/ directory in there at all. Should there be?

    Here is .htaccess from /

    # BEGIN WPSuperCache
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    AddDefaultCharset UTF-8
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP_USER_AGENT} !^.*(Android|2.0\ MMP|240x320|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|hiptop|IEMobile|iPhone|iPod|KYOCERA/WX310K|LG/U990|MIDP-2.0|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|Playstation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|Windows\ CE|WinWAP).*
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{DOCUMENT_ROOT}/blog/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
    RewriteRule ^(.*) /blog/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L]

    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP_USER_AGENT} !^.*(Android|2.0\ MMP|240x320|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|hiptop|IEMobile|iPhone|iPod|KYOCERA/WX310K|LG/U990|MIDP-2.0|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|Playstation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|Windows\ CE|WinWAP).*
    RewriteCond %{DOCUMENT_ROOT}/blog/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
    RewriteRule ^(.*) /blog/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L]
    </IfModule>

    # END WPSuperCache

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    And here is the .htaccess from /blog/wp-content/cache/

    # BEGIN supercache
    <IfModule mod_mime.c>
    <FilesMatch "\.html\.gz$">
    ForceType text/html
    FileETag None
    </FilesMatch>
    AddEncoding gzip .gz
    AddType text/html .gz
    </IfModule>
    <IfModule mod_deflate.c>
    SetEnvIfNoCase Request_URI \.gz$ no-gzip
    </IfModule>
    <IfModule mod_headers.c>
    Header set Vary "Accept-Encoding, Cookie"
    Header set Cache-Control 'max-age=300, must-revalidate'
    </IfModule>
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/html A300
    </IfModule>

    # END supercache

    Thanks for your help!

  11. donncha
    Member
    Posted 1 month ago #

    What plugins are you using? One of them could be abusing the output buffer. I found that wp-minify was and fixed it. The plugin would cache /feed/ urls and nothing else while the output buffer was corrupted.

    Your rewrite rules look ok though. Grep for ob_ in your plugins folders. One of those plugins might be dodgy.

    The following plugins use the output buffer but are ok, no need to worry about these: all-in-one-seo-pack, falbum, akismet, related-posts.php, wordpress-mobile-edition.

    The current wp-minify breaks the output buffer but the next version will be fixed.

  12. twodboy
    Member
    Posted 1 month ago #

    Interesting. I'm using akismet and Firestats. I just disabled Firestats, and tested again, but the behavior has not changed.

    We don't do anything very advanced with our server (it's dedicated) or website, and I assume all our server settings are boring and ordinary, so it's strange this doesn't seem to work for us. Let me know if there is anything else I can look up and post here for you.

  13. donncha
    Member
    Posted 1 month ago #

    I Installed WordPress in a /blog/ directory on http://cuteandinsane.com/ and Sueprcache is working ok there. The .htaccess rules are the same and cache files are generated in blog/wp-content/cache/supercache/

    Could your theme be using an output buffer? Any commands starting with ob_ in the theme files?

  14. twodboy
    Member
    Posted 1 month ago #

    I like that domain name :) Nope, "ob_" doesn't appear in any of the files in the theme's directory. It's a theme I made many wordpress versions ago (maybe two years ago?) and I wonder if themes have changed since then?

    In any case, thanks for the help!

  15. donncha
    Member
    Posted 1 month ago #

    Not sure what to suggest then. You could look through the troubleshooting section in the readme.txt but what you describe is an output buffer problem from my experience. Sorry I can't help more.

  16. mickymac101
    Member
    Posted 2 days ago #

    Don't know if its any help, but my website wasn't caching, I used the debug tool and it showed image urls that didn't exist. I had them in my css and had deleted the images. when I deleted the code from the css more files cache.

Reply

You must log in to post.

About this Topic