• I’ve been struggling for weeks trying to get mod_cache/disk to work. I don’t want to use a plugin for this, I’d like to accomplish the cache at the server level.

    This is my cache setup. Something is not right in this because when I enable it, it speeds up the site a lot, it also pretty much only shows the top page.

    For example, you can see the top page but any other page/menu/post you click on, still shows the top page. I’ve found many posts and articles but none seem to fix this problem and almost all of the replies are slight variations that don’t change anything.

    I’m showing the other section I’m using, mod_expires because I have to consider that maybe the reason is related to a combination with caching. Once I comment caching, things work again.

    I have also tried enabling the cache and disabling mod_expire but as soon as the cache is enabled, the problem shows up.

    Can anyone see what I am doing wrong in this?

    `
    #<IfModule mod_cache.c>
    # CacheQuickHandler off
    # CacheIgnoreNoLastMod On
    # CacheDefaultExpire 180
    # CacheIgnoreCacheControl On
    # CacheLastModifiedFactor 0.5
    # CacheIgnoreHeaders Set-Cookie Cookie
    # CacheHeader Off
    # CacheLock On
    # CacheDisable /wp-admin
    # CacheDisable /wp-login.php
    # CacheDisable /wp-cron.php
    # CacheDisable /wp-content
    #
    # SetOutputFilter CACHE
    # AddOutputFilterByType DEFLATE text/html text/plain text/css application/javascript application/rss+xml text/xml image/svg+xml
    #
    # CacheDetailHeader Off
    # CacheMinExpire 5
    # CacheStoreExpired Off
    # CacheLockMaxAge 5
    #
    ## <IfModule mod_mem_cache.c>
    ## CacheEnable mem /
    ## CacheSize 4096
    ## CacheMaxObjectCount 100
    ## CacheMinObjectSize 1
    ## CacheMaxObjectSize 2048
    ## </IfModule>
    #
    # <IfModule mod_cache_disk.c>
    # CacheRoot /var/cache/httpd/mod_cache_disk
    # CacheEnable disk /
    # CacheDirLevels 2
    # CacheDirLength 1
    # CacheMaxFileSize 20000000
    # </IfModule>
    #</IfModule>

    <IfModule mod_expires.c>
    ExpiresActive on
    ExpiresByType image/jpg “access 1 month”
    ExpiresByType image/jpeg “access 1 month”
    ExpiresByType image/gif “access 1 month”
    ExpiresByType image/png “access 1 month”
    ExpiresByType text/css “access 1 month”
    ExpiresByType text/html “access 1 month”
    ExpiresByType application/pdf “access 1 month”
    ExpiresByType text/x-javascript “access 1 month”
    ExpiresByType image/x-icon “access 1 month”
    ExpiresDefault “access 1 month”
    </IfModule>

    • This topic was modified 5 years, 8 months ago by bloggy2013.
    • This topic was modified 5 years, 8 months ago by bloggy2013.
    • This topic was modified 5 years, 8 months ago by bloggy2013.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter bloggy2013

    (@bloggy2013)

    With all of the folks using WP, no one seems to have any input on something like this. Where can someone get help then?

    Try:

    <IfModule mod_cache.c>
    CacheQuickHandler off
    CacheDetailHeader on

    CacheIgnoreNoLastMod On
    CacheDefaultExpire 7200

    CacheIgnoreCacheControl On
    CacheLastModifiedFactor 0.5
    CacheIgnoreHeaders Set-Cookie Cookie
    CacheHeader on
    CacheLock on
    CacheDisable /wp-admin
    CacheDisable /wp-login.php
    CacheDisable /wp-cron.php

    SetOutputFilter CACHE
    AddOutputFilterByType DEFLATE text/html text/plain text/css application/javascript application/rss+xml text/xml image/svg+xml

    # The following line could be required or not depending on your Apache installation
    LoadModule cache_disk_module modules/mod_cache_disk.so

    <IfModule mod_cache_disk.c>
    CacheRoot /var/cache/apache2/mod_cache_disk
    CacheEnable disk /
    CacheDirLevels 2
    CacheDirLength 1
    CacheMaxFileSize 2000000
    </IfModule>
    </IfModule>

    Thread Starter bloggy2013

    (@bloggy2013)

    Hi,

    Thank you for offering your setup.

    Same thing happens or maybe a little different as now the entire page turns white/blank.

    The Divi menus and logo stay but everything else on the site goes blank.
    Sure would love to take advantage of caching.

    • This reply was modified 5 years, 4 months ago by bloggy2013.
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Using mod_cache shows top page only’ is closed to new replies.