# Best Practice

## Avoid JS Exception

**Definition:** JavaScript exceptions may cause the interaction to stop, we should strive for zero exceptions, ensuring the high robustness and high availability of the program. <br>
**Scoring Standard:** Scoring Condition: No JS Exception. <br>
**Optimization Suggestions:**

- Business code needs to do try-catch for business logic, avoid uncaught exceptions.

## Use HTTPS

**Definition:** Using HTTPS protocol can ensure data security, avoiding data leaks and man-in-the-middle attacks. <br>
**Scoring Standard:** Scoring Condition: All resource requests use HTTPS protocol. <br>
**Optimization Suggestions:**

- Business code resource requests need to use HTTPS protocol, avoid unsafe resource requests.

## Package Image Detection

**Definition:** Package images larger than 100KB need optimization. <br>
**Scoring Standard:** Scoring Condition: Package image size does not exceed 100KB. <br>
**Optimization Suggestions:**

- Compress images or use CDN, avoid large package images.

## Image Domain Compliance Detection

**Definition:** Image domain not configured whitelist, or does not comply with multi-area rules, may cause to fail to access in multi-area. <br>
**Scoring Standard:** Scoring Condition: Image domain configured whitelist, and comply with multi-area rules. <br>
**Optimization Suggestions:**

- Ensure image domain configured whitelist, and comply with multi-area rules.

## DP Reporting Frequency Detection

**Definition:** DP reporting frequency should not exceed one per second, if higher than one, should prompt developers to pay attention, only panel business detection. <br>  
**Scoring Standard:** DP reporting frequency per second does not exceed one. <br>
**Optimization Suggestions:**

- If the number of DP reports per second exceeds one, attention should be paid to whether there are abnormal reports.
