We’ve been using Blocks on a new site hosted on Pantheon, which we’re experienced with for several other clients. Using the JSON loading method for the Blocks. Everything’s fine on the Dev and Test servers when we make changes to CSS for a Block, but when we push it to Live, it appears that CSS loaded via register_block_type
isn’t affected by a Clear Cache on the server. WordPress adds a version number to the end of the URL:
/blocks/nid-2025/styles.css?ver=6.7.1
and that shows the cached version, but if I strip the version number off:
/blocks/nid-2025/styles.css
I can see the new CSS on the server
Has anyone run into this and got a solution? We’ve figured one out, but it breaks the Editor preview of the block and I’d prefer to have my cake and eat it too.
We’re using a version value in the JSON to both break the cache and preserve preview in Edit mode, but I’d prefer an automatic method.