For Shopify app developers, finding new ways to manage resource-intensive tasks without degrading user experience is paramount. Traditional methods, like long-running foreground operations, are impractical as they can lead to significant delays, potentially increasing user churn. Recognizing this challenge, our team at Shopvana explored alternative approaches to optimize our app's performance, specifically focusing on image compression and AI-generated alt text implementation for Shopify stores.

The Challenge: Managing Heavy-Duty Tasks Without Impeding User Experience

Our objective was to handle potentially cumbersome operations—compressing images and adding alt text to thousands of images—without forcing the user to endure lengthy loading times. Traditional tools such as Redis or Google Cloud Tasks, while powerful, involve complex setups and are often overkill for smaller operations. On the other hand, services like Trigger.dev, although user-friendly, could escalate costs significantly.

The Solution: Gadget’s Background Actions

To avoid making major changes to the user experience or paying more than we already were, we  used  Gadget’s newly launched background actions. This functionality allows tasks to run asynchronously, which is crucial for maintaining a responsive application while managing heavy-duty processes. The implementation process was straightforward, involving minimal changes to our existing codebase, a crucial factor in agile development environments.

// Sample code snippet for enqueuing a background job in Gadget

api.enqueue(api.bgJobs.OptimiseImages, {

 shopId: connections.shopify.currentShop.id,

});

Gadget not only simplified the execution of background tasks but also provided built-in tools to monitor these jobs. Their background job execution viewer is particularly useful, offering real-time insights into the status of ongoing processes.

Monitoring and Feedback Mechanism

To enhance our monitoring capabilities and improve transparency with our clients, we developed a custom model to manage and store the statuses of these background jobs. This model allows us to safely expose job status data through a user-friendly interface directly within our Shopify app. Clients can now view real-time updates on the tasks they initiate, fostering a greater sense of trust and involvement.

Additionally, to further enhance our app's reliability, we implemented a system to notify users of the success or failure of operations. This feature sends email notifications based on the outcome of the background tasks, significantly improving the communication loop with our users and ensuring transparency.

Results and Impact

The integration of Gadget's background actions into our Shopify app allowed us to efficiently compress images and generate alt text for thousands of images without compromising the user experience. This approach not only reduced the load on our servers but also allowed our clients to continue interacting with the app seamlessly.It also reduced our server costs as we didn’t had to pay to 3rd party services for background processes

Conclusion

The use of Gadget’s background actions proved to be a game-changer in how we handle data-intensive tasks within our Shopify apps. This tool has enabled us to optimize our app’s performance, improve server efficiency, and maintain a high level of user satisfaction. For other developers in the Shopify ecosystem looking to enhance app responsiveness while managing heavy backend operations, Gadget’s background actions offer a potent solution that balances simplicity with efficiency.



TK

Write by

With years of experience in the field, TK has honed his skills to create innovative and high-performing Shopify apps and stores.

We make your D2C business shine

Book a call to see how Shopvana can help elevate your Shopify experience to the next level.

  • Shopify Partner

  • Shopify App Develoment

  • Theme Customisation

  • Custom App

  • Theme Development

  • Speed Optimisation

  • Discovering Apps

  • Integrations

We make your D2C business shine

Book a call to see how Shopvana can help elevate your Shopify experience to the next level.

  • Shopify Partner

  • Shopify App Develoment

  • Theme Customisation

  • Custom App

  • Theme Development

  • Speed Optimisation

  • Discovering Apps

  • Integrations

We make your D2C business shine

Book a call to see how Shopvana can help elevate your Shopify experience to the next level.

  • Shopify Partner

  • Shopify App Develoment

  • Theme Customisation

  • Custom App

  • Theme Development

  • Speed Optimisation

  • Discovering Apps

  • Integrations

We make your D2C business shine

Book a call to see how Shopvana can help elevate your Shopify experience to the next level.

  • Shopify Partner

  • Shopify App Develoment

  • Theme Customisation

  • Custom App

  • Theme Development

  • Speed Optimisation

  • Discovering Apps

  • Integrations