• Galerio

    (@galerio)


    I have my WordPress on the root of website and I have actived W3TC but its htacces’ rules of cache are affecting the behaviour of my forum at /forum directory. In particular when a page of the forum is changed, the browsers show the old page and to see changes you must force a page reload or you must disable browser cache. In this way when you login, then the page shows that you are not logged in, or when you post a message, you can’t see the message posted.

    By now I have added a “no-cache header” to my forum’s pages, but this is not acceptable.

    How can I exclude the /forum directory at all?

    Thanks

Viewing 13 replies - 1 through 13 (of 13 total)
  • kfawcett

    (@kfawcett)

    Look under the Page Cache settings page. There is a section to specify pages to never cache. Put “forum” in there on its own line.

    That should work.

    kfawcett

    (@kfawcett)

    OR /forum/*

    Thread Starter Galerio

    (@galerio)

    I tried but it doesn’t work.
    The option add this to htaccess:

    RewriteCond %{REQUEST_URI} !(\/wp-admin\/|\/xmlrpc.php|\/wp-(app|cron|login|register|mail)\.php|wp-.*\.php|index\.php|/forum/*|forum) [NC,OR]

    I think I have to use \/forum\/ instead of /forum/*.

    Now I try and let you know.

    Thread Starter Galerio

    (@galerio)

    No, also with \/forum\/ the cached pages are not refreshed by the browser.
    Maybe I have to set the exclusion also in other part. I’ll try.

    kfawcett

    (@kfawcett)

    Make sure to purge your cache and then refresh your browser at least two times. Then see if it works.

    kfawcett

    (@kfawcett)

    maybe add the /forum/* to the “Never Cache” sections in the database cache and object cache settings area also?

    Thread Starter Galerio

    (@galerio)

    No, nothing, I addedd \/forum\/ to all exclusion fields, but I always have cache problems.

    Thread Starter Galerio

    (@galerio)

    I have found that the problem is the option
    Viewing: Browser Cache Settings -> HTML -> Set expires header
    With it active, my forum has the refresh issue, without it all is fine.

    So, how can I exlude my forum directory?

    The part of htaccess file that is involved in this problem is within <IfModule mod_mime.c>:

    AddType text/html .html .htm
        AddType text/richtext .rtf .rtx
        AddType image/svg+xml .svg .svgz
        AddType text/plain .txt
        AddType text/xsd .xsd
        AddType text/xsl .xsl
        AddType text/xml .xml

    and within <IfModule mod_expires.c>:

    ExpiresByType text/html A360000
        ExpiresByType text/richtext A360000
        ExpiresByType image/svg+xml A360000
        ExpiresByType text/plain A360000
        ExpiresByType text/xsd A360000
        ExpiresByType text/xsl A360000
        ExpiresByType text/xml A360000

    (theese are the codes added by the option Set expires header for html content).

    Did anyone ever find a solution to this? I have EXACTLY the same problem, but definitely don’t want to turn html browser caching off my wordpress site.

    Thread Starter Galerio

    (@galerio)

    No, I have had to disable the feature.
    If anyone else have the solution, please, write it.

    Plugin Contributor Frederick Townes

    (@fredericktownes)

    Sorry, unfortunately there’s no way to do that “exclusion” in the plugin.

    Is there a definitive answer here – all we want to do is affirmatively *exclude* the forum subdirectory from browser / page caching.

    Plugin Contributor Frederick Townes

    (@fredericktownes)

    You can add ExpiresActive off directive to .htaccess directive you need to be excluded from global policies W3TC sets.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘[Plugin: W3 Total Cache] Exclude a directory from the htaccess rules’ is closed to new replies.