Title: 504 Timeout When Publishing Posts with WP Optimize Cache Enabled
Last modified: June 17, 2025

---

# 504 Timeout When Publishing Posts with WP Optimize Cache Enabled

 *  Resolved [myscenatech0](https://wordpress.org/support/users/myscenatech0/)
 * (@myscenatech0)
 * [11 months, 2 weeks ago](https://wordpress.org/support/topic/504-timeout-when-publishing-posts-with-wp-optimize-cache-enabled/)
 * Hi,
   I’m running WP Optimize on our main site and ran into a serious issue: when
   the cache is enabled, trying to **publish new posts causes 504 Gateway Timeout
   errors** — especially with the **Classic Editor**.
 * Here’s what we’ve observed:
    - **Disabling WP Optimize cache** allows publishing posts immediately.
    - With cache enabled, publishing times out — **even when preload is not fully
      complete**.
    - We tested on a staging site (Admin2) as well, and the same issue happens.
    - Posts take 20–25 seconds to save using the **Block Editor**, but it still 
      works.
    - With the **Classic Editor** + cache enabled, saving fails with 504 error.
    - With **cache disabled**, posts save in about 5 seconds with either editor.
 * It seems this may be related to how WP Optimize interacts with the Classic Editor
   on post publish (possibly preloading or cache regeneration logic?).
 * Has anyone encountered this?
   Is there a way to delay or defer preloading/cache
   regeneration to avoid impacting post-publish actions?
 * Thanks in advance!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2F504-timeout-when-publishing-posts-with-wp-optimize-cache-enabled%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [statyanenko](https://wordpress.org/support/users/statyanenko/)
 * (@statyanenko)
 * [11 months, 2 weeks ago](https://wordpress.org/support/topic/504-timeout-when-publishing-posts-with-wp-optimize-cache-enabled/#post-18516587)
 * Hi [@myscenatech0](https://wordpress.org/support/users/myscenatech0/)
 * Please try disabling the** “Automatically preload content after it is purged”**
   option (Cache > Page Cache > Purge the Cache section) and see if the issue still
   occurs.
   If that helps, you can set up **scheduled preloading** instead of immediate
   preloading (Cache > Preload tab).
 *  [christer_f](https://wordpress.org/support/users/christer_f/)
 * (@christer_f)
 * [10 months, 3 weeks ago](https://wordpress.org/support/topic/504-timeout-when-publishing-posts-with-wp-optimize-cache-enabled/#post-18546376)
 * Hi [@statyanenko](https://wordpress.org/support/users/statyanenko/)
 * I had the same issue. Your suggestion seems to have fixed it. I don’t know exactly
   when this started, possibly with the update to WP 6.8.1

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

The topic ‘504 Timeout When Publishing Posts with WP Optimize Cache Enabled’ is 
closed to new replies.

 * ![](https://ps.w.org/wp-optimize/assets/icon-256x256.png?rev=1552899)
 * [WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance](https://wordpress.org/plugins/wp-optimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-optimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-optimize/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-optimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-optimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-optimize/reviews/)

## Tags

 * [cache](https://wordpress.org/support/topic-tag/cache/)

 * 2 replies
 * 3 participants
 * Last reply from: [christer_f](https://wordpress.org/support/users/christer_f/)
 * Last activity: [10 months, 3 weeks ago](https://wordpress.org/support/topic/504-timeout-when-publishing-posts-with-wp-optimize-cache-enabled/#post-18546376)
 * Status: resolved