13

One of the most useful tips I've come across when developing lightning components in Salesforce is to disable caching, as otherwise Salesforce tends to aggressively cache components which makes development a nightmare.

However, now I'm using DX I'm having to do this manually in every scratch org I create, which is a real pain. Is there an option to do this automatically, either via a DX command org via the scratch org JSON definition file?

2 Answers 2

17

Yes, you can disable caching in scratch org by specifying S1EncryptedStoragePref2 as disabled org preferences in your scratch org definition file.

{
    "orgName": "DevOrg",
    "edition": "Developer",
    "orgPreferences" : {
        "enabled": ["S1DesktopEnabled"],
        "disabled": ["S1EncryptedStoragePref2"]
    }
}

Thanks René Winkelmeye for this hint: https://twitter.com/muenzpraeger/status/961826088954486791

1
3

In the new scratch def format, here's the correct syntax:

{
    "orgName": "DevOrg",
    "edition": "Developer",
    "settings": {
        "orgPreferenceSettings" : {
            "enableS1EncryptedStoragePref2": false,
            "enableS1DesktopEnabled": true
        }
    }
}

....or this:

{
    "orgName": "DevOrg",
    "edition": "Developer",
    "settings": {
        "lightningExperienceSettings": {
            "enableS1DesktopEnabled": true
        },
        "mobileSettings": {
            "enableS1EncryptedStoragePref2": false
        },
    }
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .