Title: Cache invalidation issue &#8211; static front page
Last modified: August 20, 2016

---

# Cache invalidation issue – static front page

 *  Resolved [FolioVision](https://wordpress.org/support/users/foliovision/)
 * (@foliovision)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/)
 * Hello Stefano,
 * we found another bug. This applies to sites which have Settings –> Reading –>
   Front page displays set to “A static page”.
 * Cache for such page is not cleared when you publish a new blog post. Imagine 
   you have homepage with a featured posts slider and some intro text and then a
   real blog page on /blog address with a classic list of recent posts.
 * Under these conditions, your cache.php sets the front page type “page” instead
   of “home”. The condition
 * `if (is_home() || is_front_page()) $data['type'] = 'home';`
 * Needs to be changed to:
 * `if (is_home() || is_front_page()) $data['type'] = 'home';`
 * Then the special front page cache is cleared properly when a new blog post is
   created.
 * This is crucial if the cache time is set to full day (your current default I 
   believe) and it’s set to only clear the post, homepage and archive cache when
   a post is published/updated.
 * Could you please roll out a quick update version, so we don’t have to fix this
   by hand on a lot of our sites?
 * Thanks,
    Martin
 * [http://wordpress.org/extend/plugins/hyper-cache/](http://wordpress.org/extend/plugins/hyper-cache/)

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/page/2/?output_format=md)

 *  Thread Starter [FolioVision](https://wordpress.org/support/users/foliovision/)
 * (@foliovision)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/#post-3390116)
 * Hello all,
 * there was a new version one day ago and this was not addressed, so we can’t upgrade
   the plugin on our sites.
 * Of course, the original line is just this:
 * `if (is_home() || is_front_page()) $data['type'] = 'home';`
 * So the `|| is_front_page()` part is added.
 * Thanks,
    Martin
 *  [martinjesus](https://wordpress.org/support/users/martinjesus/)
 * (@martinjesus)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/#post-3390137)
 * Hi there,
 * I have my HOME page as a static page on Settings –> Reading. But it is not properly
   cleared when I do a post modification, although I’ve done the modification proposed
   by FolioVision.
 * (And Cache invalidation mode -> Only modified post; and “Invalidate home, archives,
   categories on single post invalidation” is checked).
 * Any ideas or help?
 * Thanks in advance for your support.
    Jesus
 *  [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/#post-3390138)
 * Hello [@foliovision](https://wordpress.org/support/users/foliovision/), can you
   elaborate a bit more what you changed in the code? You typed the following:
 * > Under these conditions, your cache.php sets the front page type “page” instead
   > of “home”. The condition
   > if (is_home() || is_front_page()) $data[‘type’] = ‘home’;
   > Needs to be changed to:
   > if (is_home() || is_front_page()) $data[‘type’] = ‘home’;
 * . What is see is that both codes are identical.
 * Kind regards
 *  Thread Starter [FolioVision](https://wordpress.org/support/users/foliovision/)
 * (@foliovision)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/#post-3390139)
 * Hello **mbrsolution**,
 * please read my second post. I made a mistake so I corrected it there.
 * Hello **martinjesus**,
 * either `is_front_page()` or `is_home()` should return true on your home page.
 * You should double check if your conditional tags behave properly on your home
   page, specially if you use a custom page template which pulls in posts from some
   category, or there might be a conflicting widget too. Both of that might reset
   your conditional tags and cause the above condition return `false`.
 * Other idea would be to also add `is_page( get_option('page_on_front') )`. However
   the goal is to provide an universal fix and is_front_page() should be enough.
 * More about conditional tags: [http://codex.wordpress.org/Conditional_Tags](http://codex.wordpress.org/Conditional_Tags)
 * There might be some other bug too. You can even enable Hyper Cache log (you need
   to uncomment the code in the plugin – look up function hyper_log()) and then 
   add in your own logging to figure out the issue.
 * Thanks,
    Martin
 *  [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/#post-3390140)
 * Hello [@foliovision](https://wordpress.org/support/users/foliovision/), thank
   you for pointing to the second post. I was not sure that is why I ask. I do apologize
   for my blindness.
 * Kind regards
 *  [evo252](https://wordpress.org/support/users/evo252/)
 * (@evo252)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/#post-3390141)
 * Thank you so much FolioVision!
 *  [evo252](https://wordpress.org/support/users/evo252/)
 * (@evo252)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/#post-3390142)
 * Personally, I solved my issue by typing this (if it can help someone that may
   have a similar template):
 * `if (is_home() || is_front_page() || is_page_template( 'template-blogall.php'))
   $data['type'] = 'home';`
 * Because I’m using a custom page template, and it seems that front_page didn’t
   solved my issue.
 *  [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/#post-3390143)
 * Hi, I tested the settings above but in my situation it produces the famous screen
   of death 🙂 so I had to delete the following entry `|| is_front_page()`. Well
   I guess I don’t need the fix then. But very strange that you apply the fix and
   nothing happens to both of you.
 * Thank you anyhow I am sure someone will use this setting.
 *  [martinjesus](https://wordpress.org/support/users/martinjesus/)
 * (@martinjesus)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/#post-3390144)
 * Hi FolioVision, mbrsolution and evo252,
 * First of all, thank you for your responses.
 * I’ve tried with “is_page( get_option(‘page_on_front’) )” and with “is_page_template(‘
   myownhometemplate.php’ ) )”, and they do not work for me.
 * I will ask my template supplier for the way they identificate the home page, 
   and if I arrive to a solution, I will let you know.
 * Thanks to all!
 *  [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [13 years ago](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/#post-3390149)
 * Hello all, just wanted to catch up and find out if your solutions above have 
   been working fine.
 * Is there anything else one could add or edit to improve this?
 * Kind regards
 *  Thread Starter [FolioVision](https://wordpress.org/support/users/foliovision/)
 * (@foliovision)
 * [13 years ago](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/#post-3390150)
 * Hello mbrsolution,
 * we had no further issues after applying our fix. We do a lot of custom template
   programming, so if we see any issues next time, we will drop a note in here.
 * However is there any Github repository for the plugin? That would make submitting
   bug fixes more efficient.
 * Thanks,
    Martin
 *  [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [13 years ago](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/#post-3390151)
 * Hello Martin, unfortunately I don’t know where you could add your fix to unless
   you ask Stefano Lissa.
 * I would like to ask you if you don’t mind what are your current settings for 
   this plugin that works best for your website? I am trying to setup the best configuration
   to improve my website’s performance.
 * Kind regards
 *  Thread Starter [FolioVision](https://wordpress.org/support/users/foliovision/)
 * (@foliovision)
 * [13 years ago](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/#post-3390152)
 * Hello mbrsolution,
 * we don’t really use any special config. If the home page or front page is properly
   recognized in the plugin (see above fix), then the caching time can be set to
   1 full day without any problems.
 * We just make sure the theme switching works for the sites which use WPTouch Pro,
   so we exclude wptouch-pro-view and wptouch_switch_toggle cookies. We also update
   the list of mobile user agents to match WPTouch Pro.
 * Thanks,
    Martin
 *  [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [13 years ago](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/#post-3390154)
 * Hello FolioVision, thank you for your information.
 * I use WPTouch but not WPTouch Pro. The problem that I am having is that some 
   pages or post don’t get cached correctly and on the PC or laptop browser the 
   mobile view is displayed instead of the normal WordPress theme.
 * You mention that you exclude **wptouch-pro-view** and **wptouch_switch_toggle**
   cookies. Where do you enter these code in the plugin to exclude it.
 * Kind regards
 *  Thread Starter [FolioVision](https://wordpress.org/support/users/foliovision/)
 * (@foliovision)
 * [13 years ago](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/#post-3390156)
 * Hello mbrsolution,
 * you need to watch out for this when you test caching.
 * We have an older article about the mobile site setup process. It’s back from 
   days when we used WP Super Cache. I did a quick update to it, just read what’s
   below “If you use Hyper Cache”: [http://foliovision.com/2011/06/build-mobile-version-website](http://foliovision.com/2011/06/build-mobile-version-website)
 * Thanks,
    Martin

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/page/2/?output_format=md)

The topic ‘Cache invalidation issue – static front page’ is closed to new replies.

 * ![](https://ps.w.org/hyper-cache/assets/icon-256x256.png?rev=3452725)
 * [Hyper Cache](https://wordpress.org/plugins/hyper-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/hyper-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/hyper-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/hyper-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/hyper-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/hyper-cache/reviews/)

 * 22 replies
 * 5 participants
 * Last reply from: [FolioVision](https://wordpress.org/support/users/foliovision/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/cache-invalidation-issue-static-front-page/page/2/#post-3390186)
 * Status: resolved