👀 See Sanity in action: Watch product demo now →

How to Optimize Sanity Studio for Longer Articles

8 replies
Last updated: Aug 11, 2022
When we’re writing articles with a lot of content and code blocks, Sanity studio (deployed) becomes unresponsive and sometimes we have to wait 3 to 5 minutes for it to become responsive again. We also have to rush to make some changes before the auto save happens, because this seems to be where everything gets really bad. For most of our articles, it’s great and we don’t have anything to worry about, but our longer ones are an absolute nightmare to manage. Does anyone have any optimization tips for the studio? On these articles, all we’re using is
@sanity/code-input
and the basic blocks. Sample:

{
  name      : 'content',
  title     : 'Content',
  validation: (Rule) => Rule.required(),
  type      : 'array',
  of        : [
    {
      title: 'Block',
      type: 'block',
      styles: [
        { title: 'Paragraph', value: 'normal' },
        { title: 'H2', value: 'h2' },
        { title: 'H3', value: 'h3' },
        { title: 'H4', value: 'h4' },
        { title: 'H5', value: 'h5' },
        { title: 'H6', value: 'h6' },
        { title: 'Quote', value: 'blockquote' },
      ],
      marks: {
        decorators: [
          {title: 'Strong', value: 'strong'},
          {title: 'Emphasis', value: 'em'},
        ],
      },
    },
    {
      type: 'code',
      icon: MdCode,
    },
  ],
},
Aug 11, 2022, 9:03 PM
What version of the Studio are you running?
Aug 11, 2022, 9:19 PM
2.30.4
Aug 11, 2022, 9:30 PM
Got it. There are some performance issues that are currently being worked on. You can, however, use this tagged release until it's ready for general release:
sanity upgrade --tag=performance-opts --save-exact
Aug 11, 2022, 9:33 PM
Wonderful! We’ll give it a shot. Thanks for your help. 🙂
Aug 11, 2022, 9:37 PM
Feel free to share any feedback/issues you experience, as well!
Aug 11, 2022, 9:37 PM
Will do!
Aug 11, 2022, 9:37 PM
So far this is about 1,000,000 times faster and it’s actually useable for our team now. Thank you very much again! You’re a lifesaver! 🙂
Aug 11, 2022, 9:46 PM
I'm so glad!!
Aug 11, 2022, 9:48 PM

Sanity.io – build remarkable experiences at scale

Sanity is a customizable solution that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.