How to Load development version of assets on prod for testing

dev-to-production

Introduction

Testing development versions of assets directly in production can be risky, potentially disrupting your live environment and affecting end-users. The challenge of validating new features or bug fixes without impacting users complicates the process.

Requestly simplifies this by allowing you to test development versions safely by redirecting network calls, ensuring a smooth validation process without disrupting your live site.

Load dev version of assets

The Redirect Rule in Requestly lets you redirect requests to development versions of assets instead of the production ones. This is particularly useful for testing and validating changes in a controlled environment without impacting live users.

Load development version
  • Another URL: You can redirect the request to a different URL. In this case, the redirection is happening to a new JavaScript file URL.
  • Local File: This option lets you redirect to a local file stored on your machine.
  • From Files/Mock server: You can also choose to redirect the request to a file hosted on a mock server or from files you’ve set up.
  • Source Condition: This determines which requests will be redirected. Here, any request containing https://example.com/production-asset.js will be redirected.
  • Destination URL: This is the URL where the request is redirected. In the example, it’s redirecting to a new debug script.
  • Test URL Condition: You can check if the rules you’ve set up work correctly by testing them on specific URLs.
  • Filter Out Condition: You can apply filters to limit which requests are affected, making sure only the ones you want are modified.

Or create your own Rule by following the steps below

Here’s how to set up a redirect rule to load development versions of assets on production for testing:

  1. Open Requestly: Open the Requestly app.
  2. Create a New Rule: Click on New Rule and select Redirect Rule.
  3. Enter the Production Asset URL Pattern: Add the URL pattern for the production assets you want to replace with development versions.
  4. Specify the Development Asset URL: Enter the URL of the development version of the asset. This URL will be the target of the redirect.
    • Example Production URL: https://example.com/production-asset.js
    • Example Development URL: https://example.com/dev-asset.js
  5. Save the Rule: Click ‘Save’ to create the rule and ensure it is activated by toggling the switch to the ‘On’ position.

Interactive Guide

Check this interactive and easy explanation of how to create Redirect rule.

Conclusion

Try this redirect rule to load development versions of assets in production for testing, ensuring changes are verified without impacting live data. Requestly is trusted by over 200k developers and 1000+ corporates for its efficiency in managing network requests.

Explore More:

Share this article:

Subscribe to our weekly newsletter !

Join 10k developers and QAs to get weekly updates with Requestly's newsletter.​

This article was written by:

Picture of Kanishk Rawat

Kanishk Rawat

Kanishk Rawat, a tech enthusiast since childhood, has mastered programming through dedication. Whether solo or in a team, he thrives on challenges, crafting innovative solutions .

Join 10k developers and get weekly updates with Requestly's newsletter.

Contents