Title: Multisite delete cache problem
Last modified: July 19, 2021

---

# Multisite delete cache problem

 *  [bwbalazs](https://wordpress.org/support/users/bwbalazs/)
 * (@bwbalazs)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/multisite-delete-cache-problem/)
 * Hi.
 * I have a cronjob which runs every 10 minutes.
    We have a WordPress multisite 
   installation with 2 sites (on separate domains) in the multisite network. We 
   are creating/updating/deleting WP Job Manager posts with this php cron script.
   And everything is cached with WP Fastest Cache.
 * So here is my problem:
    I am calling the cronjob on Site1 (example.hu/do-cron.
   php), and this script manipulates data on both multisite websites. I am switching
   between WP multisite with the standard switch_to_blog() function provided by 
   WP.
 * When everything is done, I want to delete the WPFC cache for both sites. I use
   the following functions to do so:
    wpfc_clear_all_cache(); wpfc_clear_all_cache(
   true);
 * However if you look inside the getWpContentDir() WPFC function’s code (which 
   is used by the previously mentioned function), you can see it determines the 
   current website’s domain name from $_SERVER[‘HTTP_HOST’] – instead of using the
   standard get_site_url() WordPress function.
    The difference here is that standard
   WP function handles multisite’s switch_to_blog() functions, while the $_SERVER
   variable obviously doesn’t.
 * In this case because I called the cronjob from Site1, it only deletes cache for
   Site1, even if I switch to Site2 via the switch_to_blog() function because it
   gets the site url from the server variable.
 * Edit: this feature is implemented for WPML in the getWpContentDir() function.
   The same would be the intended behavior for multisite websites.
 * Could you please fix this issue?
 * Thanks a lot,
    Balazs

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Emre Vona](https://wordpress.org/support/users/emrevona/)
 * (@emrevona)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/multisite-delete-cache-problem/#post-14679838)
 * please contact me via email: [https://www.wpfastestcache.com/contact-us/](https://www.wpfastestcache.com/contact-us/)
 *  Thread Starter [bwbalazs](https://wordpress.org/support/users/bwbalazs/)
 * (@bwbalazs)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/multisite-delete-cache-problem/#post-14679957)
 * I sent you an email.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Multisite delete cache problem’ is closed to new replies.

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

 * 2 replies
 * 2 participants
 * Last reply from: [bwbalazs](https://wordpress.org/support/users/bwbalazs/)
 * Last activity: [4 years, 10 months ago](https://wordpress.org/support/topic/multisite-delete-cache-problem/#post-14679957)
 * Status: not resolved