SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Feb 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wp Super Cache serve non-cache to specific User Agent?

    I'm using Wp Super Cache which is a very important plugin for my site, basically I can't run my website without it and not with other cache plugin. What I want to do is somehow serve non-cached to Googlebot using .htaccess with something like rewritecond user agent !googlebot, but I don't know how to do this. I already search the internet, couldn't find anything that helps on my level. Does anyone know how to do this?

  2. #2
    SitePoint Member
    Join Date
    Feb 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What I've tried so far

    Code:
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    # ADDED THIS LINE TO PASS-THROUGH USER AGENTS
    RewriteCond %{HTTP_USER_AGENT} !(Googlebot|Google|Adsense)
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html.gz -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{SERVER_NAME}/$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_).*$
    # ADDED THIS LINE TO PASS-THROUGH USER AGENTS
    RewriteCond %{HTTP_USER_AGENT} !(Googlebot|Google|Adsense)
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html [L]
    Didn't worked, still getting cached content

  3. #3
    SitePoint Member
    Join Date
    May 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to edit the config file in wp super cache to get it work.

  4. #4
    SitePoint Member
    Join Date
    May 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Super cache is not best. I suggest you to try Wp-Optimize plugin. This plugin really increases speed of your website


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •