How the New XPath‑Based Cache Boosts AI Automation Performance by 37%
The update introduces a YAML‑based cache with precise XPath targeting, dual‑validation and smart fallback, a structured API for extracting booleans, numbers, strings and queries, enhanced replay reports with custom nodes and video export, plus extensive web, Android, and reporting optimizations that dramatically improve performance and reduce report size.
1. Brand‑New Cache Solution: Precise XPath Targeting
The refactored cache brings revolutionary improvements:
YAML‑format cache files : Improves readability and maintainability.
Dual‑validation mechanism : Ensures precise cache hits.
Smart fallback mechanism : Automatically switches to AI positioning when the cache expires.
Typical performance boost : Cache hit rate increased by 37%.
2. Structured API: New Dimensions for Data Extraction
Supports multiple structured data extraction methods: aiBoolean: Conditional checks (e.g., status verification). aiNumber: Numeric extraction (e.g., unread message count). aiString: Text extraction (e.g., username retrieval). aiQuery: Flexible data‑structure queries.
Code example:
// Check if a record contains the "Completed" tag
const hasCompleted = await agent.aiBoolean('Check if record contains "Completed" text')For more structured API usage, see "Using JavaScript to Optimize AI Automation Code".
3. Enhanced Replay Report
Custom Report Nodes
Added logScreenshot API to insert key‑node screenshots.
Supports adding custom description text.
Applicable for error capture and UI verification.
Video Export Feature
One‑click export of the report process video.
Facilitates issue reproduction and result sharing.
4. Execution Process Data Pivot
Using the _unstableLogContent API you can obtain:
Detailed timing analysis for each step.
AI token consumption details.
Full screenshots of operation nodes.
By leveraging this data, you can even craft a custom report tailored to your needs.
// Retrieve the full execution log
const logContent = agent._unstableLogContent()⚡ Other Important Optimizations
Web Integration Enhancements : New aiAsk method for direct AI queries to obtain page information.
Android Improvements : Supports task interruption, enhanced pixel‑ratio calculation, and optimized ADB configuration.
Report Size Optimization : Typical complex page report size reduced from 47.6 MB to 15.6 MB.
DOM Visual Capabilities : Supports extraction of hidden page attributes such as link URLs.
🛠️ Developer tip: All these features are now live! Upgrade immediately to experience them.
Full changelog available in the update log.
References
[1] "Using JavaScript to Optimize AI Automation Code": https://midscenejs.com/zh/blog-programming-practice-using-structured-api.html
[2] Update log: https://midscenejs.com/zh/changelog.html
ByteDance Web Infra
ByteDance Web Infra team, focused on delivering excellent technical solutions, building an open tech ecosystem, and advancing front-end technology within the company and the industry | The best way to predict the future is to create it
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
