cancel
Showing results for 
Search instead for 
Did you mean: 

FPC/Redis cache not invalidating when pages are modified

FPC/Redis cache not invalidating when pages are modified

I have an issue with a site that I'm consulting on right now where page modifications (for instance to static pages, which is how we've been testing this) are not invaliding the cache properly.  Honestly, I'm still learning quite a bit about redis and the FPC at current; that's where I (and another dev on the team) are assuming that things are going bad at this point.  Basically the issue is that if any changes are made to [one of the static content] pages, the cache is [presumably] not invalidating, and the previously warmed page continues to be served until caches are manually flushed.  For awhile we thought that the issue had to deal with redis no longer being hooked up to FPC, but it appears that those were two separate issues and that FPC<-->redis is now working properly, while the page invalidation is still not working as [we feel] it should.

 

Can anybody tell me a little bit more about the behavior of redis/FPC caching and modification of the cached pages?  Is there supposed to be some sort of invalidation going on, or is this a feature that does not exist?  I've studied the page at Colin Mollenhour's GitHub repo on Cm_Cache_Backend_Redis and Magento DevDocs, and unfortunately, I don't seem to be able to find anything regarding this issue mentioned on there.  I've been looking for more documentation elsewhere, but I don't seem to be able to find any resources anywhere with my level of Google-fu.

 

I'll go ahead and add a copy of our local.xml, with sensitive data redacted, in case that is helpful at all.  I am currently aware of the unrelated issues regarding a single instance of redis handling 3 caches, as well as the issues with redis's transparent compression rendering the 'gzip' compression setting redundant in this file, in case you notice.  Smiley Wink  Any pointers in the right direction, direct assistance, or helpful hints on the page/cache invalidation are very greatly appreciated.

 

TIA

 

Contents of local.xml follow:

 

<config>
    <global>
        <install>
            <date><![CDATA[Tue, 12 Aug 2014 09:19:47 +0000]]></date>
        </install>
        <crypt>
          <key>***[redacted]***</key>
        </crypt>
        <disable_local_modules>false</disable_local_modules>
        <resources>
            <db>
                <table_prefix><![CDATA[]]></table_prefix>
            </db>
            <default_setup>
                <connection>
                    <host><![CDATA[localhost]]></host>
                    <username>***[redacted]***</username>
                    <password>***[redacted]***</password>
                    <dbname>***[redacted]***</dbname>
                    <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
                    <model><![CDATA[mysql4]]></model>
                    <type><![CDATA[pdo_mysql]]></type>
                    <pdoType><![CDATA[]]></pdoType>
                    <active>1</active>
                </connection>
            </default_setup>
        </resources>
        <session_save><![CDATA[db]]></session_save>

        <redis_session>
            <host>127.0.0.1</host>
            <port>6379</port>
            <password>***[redacted]***</password>
            <timeout>2.5</timeout>
            <persistent></persistent>
            <db>2</db>
            <compression_threshold>2048</compression_threshold>
            <compression_lib>lzf</compression_lib>
            <log_level>1</log_level>
            <max_concurrency>6</max_concurrency>
            <break_after_frontend>5</break_after_frontend>
            <break_after_adminhtml>30</break_after_adminhtml>
            <first_lifetime>600</first_lifetime>
            <bot_first_lifetime>60</bot_first_lifetime>
            <bot_lifetime>7200</bot_lifetime>
            <disable_locking>0</disable_locking>
            <min_lifetime>60</min_lifetime>
            <max_lifetime>2592000</max_lifetime>
        </redis_session>

      <cache>
        <backend>Cm_Cache_Backend_Redis</backend>
        <backend_options>
          <server>127.0.0.1</server> <!-- or absolute path to unix socket -->
          <port>6379</port>
          <persistent></persistent>
          <database>0</database>
          <password>***[redacted]***</password>
          <force_standalone>0</force_standalone>
          <connect_retries>1</connect_retries>
          <automatic_cleaning_factor>0</automatic_cleaning_factor>
          <compress_data>1</compress_data>
          <compress_tags>1</compress_tags>
          <compress_threshold>20480</compress_threshold>
          <compression_lib>gzip</compression_lib> <!-- Supports gzip, lzf and snappy -->
        </backend_options>
      </cache>

      <fpc>
          <lifetime>86400</lifetime>
          <backend>Cm_Cache_Backend_Redis</backend>
          <backend_options>
              <server>127.0.0.1</server>
              <port>6379</port>
              <persistent>cache-fpc</persistent>
              <database>1</database>
              <password>***[redacted]***</password>
              <force_standalone>1</force_standalone>
              <connect_retries>1</connect_retries>
              <lifetimelimit>86400</lifetimelimit>
              <read_timeout>10</read_timeout>
              <compress_data>1</compress_data>
              <compress_tags>1</compress_tags>
              <compress_data>gzip</compress_data>
          </backend_options>
      </fpc>

    </global>

    <admin>
        <routers>
            <adminhtml>
                <args>
                    <frontName><![CDATA[admin]]></frontName>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>
Tags (3)
6 REPLIES

Re: FPC/Redis cache not invalidating when pages are modified

A few questions to get more details...

I assume you are using Magento EE and its built-in FPC? Or are you using CE with an extension?

Which version of Magento are you running?

If you disable Redis and use File based caching, does it work?

Which static content pages are being updated, and how are these updates being made? Admin panel, FTP/SSH?

Re: FPC/Redis cache not invalidating when pages are modified


robfico wrote:

A few questions to get more details...

I assume you are using Magento EE and its built-in FPC? Or are you using CE with an extension?

Which version of Magento are you running?

If you disable Redis and use File based caching, does it work?

Which static content pages are being updated, and how are these updates being made? Admin panel, FTP/SSH?


My apologies for not catching those details outright.  I'll make sure not to overlook that again.  Smiley Frustrated

 

  • currently using Magento CE 1.9.0.1
  • if redis is not the CE extension that you are alluding to (and here I'm guessing there's a large chance that I'm mistaking things) for FPC, could you allude a little bit more on what I might be looking for here? (my apologies for my ignorance; I assure you I'm working on shoving it back every day here)
  • I'm currently unable to disable redis and use file based caching due to potential production server issues; I'm starting the process of getting the person who is more involved in the troubleshooting onto one of our dev servers in order to allow this in the very near future
  • regarding your final question(s), I've requested more specific information on precisely what you've asked (method of alteration of static pages, which static pages are being changed)

I'll post more information as soon as I've got it here.  Thank you for taking the time to ask a little bit more/offer assistance.

Re: FPC/Redis cache not invalidating when pages are modified

Magento CE does not have built-in Full Page Caching. So, you either have a an extension (like Lesti, Extendware, etc...) that is performing the Full Page Caching, or you do not have it. You will want to find out which FPC extension you are using.

 

Redis is just an in-memory storage system where data can be stored for retrieval quickly.

Re: FPC/Redis cache not invalidating when pages are modified

I'm sorry for the confusion.  Looked through admin, looks like we're using Lesti.  Seen it before, just hadn't taken note of it.

Re: FPC/Redis cache not invalidating when pages are modified


robfico wrote:

A few questions to get more details...

I assume you are using Magento EE and its built-in FPC? Or are you using CE with an extension?

Which version of Magento are you running?

If you disable Redis and use File based caching, does it work?

Which static content pages are being updated, and how are these updates being made? Admin panel, FTP/SSH?


Sorry for the wait on the information with this, @robfico.  Here are some answers that might be a little more helpful to the last questions that you asked (copying answers that I got back verbatim for you here):

    • The case is with any and all static pages. Making any changes and saving, then refreshing that page on the front end using to show your updates without flushing the entire cache. I've been testing this out with the sandbox-page static page because its' just a random unlinked-to page with nothing on it.
    • The changes in question are always made through the admin in the cms section. Saving changes to pages used to work fine, but fyi saving changes to static blocks has always required a flush of the cache, so that works the same.

Hope this little bit is a bit more helpful.  I'm still working on getting our front end guy (the one that provided those answers) onto a development server so that we can do some of the troubleshooting techniques that you were talking about.

 

TIA

Re: FPC/Redis cache not invalidating when pages are modified

Lesti FPC does support page flushes automatically for the following actions (from the Lesti docs):

----
Pages will be flushed after save of product, category, cms-page and cms-block.
----

 

Per setting up Lesti with Redis, you need to configure the fpc.xml file to use Redis, and not the generic local.xml FPC method which is for Magento Enterprise. Reference:
https://support.hypernode.com/knowledgebase/configure-lestifpc/

 

See if this helps with your issues.