Title: theme.json is cached when viewing a page/post
Last modified: February 8, 2022

---

# theme.json is cached when viewing a page/post

 *  [chrion](https://wordpress.org/support/users/chrion/)
 * (@chrion)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/theme-json-caching/)
 * I’m developing a block theme in a local environment. whenever i change custom
   properties in my theme.json file the changes are not taking effect.
 * The changes IS reflected both when editing a page or navigation the new “Site
   editor”, but NOT when viewing a page.
 * I can’t seem to find any documentation on my issue.
    -  This topic was modified 4 years, 4 months ago by [chrion](https://wordpress.org/support/users/chrion/).
    -  This topic was modified 4 years, 4 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).

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

 *  [mrtom414](https://wordpress.org/support/users/mrtom414/)
 * (@mrtom414)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/theme-json-caching/#post-15342139)
 * Wish I could help but I’m pretty much in the same place you are.
 *  Thread Starter [chrion](https://wordpress.org/support/users/chrion/)
 * (@chrion)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/theme-json-caching/#post-15344825)
 * The issue is due to the front-end reading the _transient_global_styles_theme_name
   from wp_options. This transient is not getting updated when i change my theme.
   json. I’m developing in a local VVV environment.
 *  [onetrev](https://wordpress.org/support/users/onetrev/)
 * (@onetrev)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/theme-json-caching/#post-15557456)
 * Finally solved this! For performance purposes the WP team added caching to the
   global-styles output. You have to have WP_DEBUG = true in your wp-config.php 
   to ensure caching is disabled during development. For more details see the [issue in Github](https://github.com/WordPress/gutenberg/issues/25678).
 *  [Sunny](https://wordpress.org/support/users/frdmsun/)
 * (@frdmsun)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/theme-json-caching/#post-15772617)
 * Likewise, editing styles/theme.json files do not update on the front end. The
   only fix that works for me is to refresh the “Browse styles” page, and re-save.
 *  [Oliver Schmid](https://wordpress.org/support/users/webgarten/)
 * (@webgarten)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/theme-json-caching/#post-16193557)
 * [@onetrev](https://wordpress.org/support/users/onetrev/) thanks, works for me.
   `
   define('WP_DEBUG', true);`
 *  [ezoulou](https://wordpress.org/support/users/ezoulou/)
 * (@ezoulou)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/theme-json-caching/#post-16414029)
 * Hi folks,
 * Having the same kind of issue here : latest styles show ok in backoffice but 
   not in frontend (which uses data from a very old theme.json version).
 * I can fix this using either
 * `define( 'WP_DEBUG', true);`
 * or
 * `define( 'SCRIPT_DEBUG', true);`
 * Which is ok while developping. 
   But I don’t want keep these when on production.
 * Any tips on how to force clear theme.json cache?
 * Cheers
 *  Thread Starter [chrion](https://wordpress.org/support/users/chrion/)
 * (@chrion)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/theme-json-caching/#post-16414040)
 * [@ezoulou](https://wordpress.org/support/users/ezoulou/) i still use the solution
   i mentioned earlier in the post, where i have to dele the _transient_global_styles_theme_name
   row in the wp_options table
 *  [ezoulou](https://wordpress.org/support/users/ezoulou/)
 * (@ezoulou)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/theme-json-caching/#post-16414088)
 * [@chrion](https://wordpress.org/support/users/chrion/) At first I didn’t quite
   understand your #post-15344825 proposal. 
   But tryed it and it worked perfect!
   Thanks you very much. U saved my day! 🙂
 *  [Sunny](https://wordpress.org/support/users/frdmsun/)
 * (@frdmsun)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/theme-json-caching/#post-16854526)
 * Still waiting for a fix for this. If I edit styles/new-style.json it does not
   reflect on the front end.
 * Neither of these solve the issue for me: 
   `define( 'WP_DEBUG', true ); ``wp transient
   delete --all`
 * Instead I have to go the wp-admin > Browse Styles. re-select the new-style and
   resave for the changes to take effect.
 * Submitting a bug report here [https://github.com/WordPress/gutenberg/issues/52041](https://github.com/WordPress/gutenberg/issues/52041)
    -  This reply was modified 2 years, 11 months ago by [Sunny](https://wordpress.org/support/users/frdmsun/).
 *  [Sunny](https://wordpress.org/support/users/frdmsun/)
 * (@frdmsun)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/theme-json-caching/#post-17022189)
 * I believe that  `define( 'WP_DEVELOPMENT_MODE', 'theme' );` which will be introduced
   in WordPress 6.3, fixes the issue.
 *  [wpbred](https://wordpress.org/support/users/wpbred/)
 * (@wpbred)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/theme-json-caching/#post-17151473)
 * Had the same issue, tried clearing cache, set WP_DEBUG = true in the config file
   but that did not help.
 * Only solution that worked was mentioned above by [@frdmsun](https://wordpress.org/support/users/frdmsun/):
 * **I have to go the wp-admin > Browse Styles. re-select the new-style and resave
   for the changes to take effect.**
 *  [BigupJeff](https://wordpress.org/support/users/jeffersonreal/)
 * (@jeffersonreal)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/theme-json-caching/#post-17152584)
 * It seems `theme.json` and `styles/[theme-name].json` are cached differently. 
   I’ve disabled webserver cache, browser cache and implemented the debug/dev constants
   mentioned:
 * `define( 'WP_DEBUG', true );
   define( 'SCRIPT_DEBUG', true );define( 'WP_DEVELOPMENT_MODE','
   all' );define( 'WP_ENVIRONMENT_TYPE', 'local' );
 * My changes to `theme.json` now take instant effect after a page reload, but anything
   in a `styles/[theme-name].json` I have to follow the editor reset process described
   by [@wpbred](https://wordpress.org/support/users/wpbred/). Specifically:
    1. Navigate to **editor > styles**
    2. Hard reload Ctrl + F5
    3. Select and save another theme
    4. Re-select and save the theme with changes
    5. Reload front end to see changes

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

The topic ‘theme.json is cached when viewing a page/post’ is closed to new replies.

## Tags

 * [gutenberg](https://wordpress.org/support/topic-tag/gutenberg/)
 * [theme.json](https://wordpress.org/support/topic-tag/theme-json/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 12 replies
 * 8 participants
 * Last reply from: [BigupJeff](https://wordpress.org/support/users/jeffersonreal/)
 * Last activity: [2 years, 7 months ago](https://wordpress.org/support/topic/theme-json-caching/#post-17152584)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
