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.
How to Load development version of assets on prod for testing
Kanishk Rawat
September 6, 2024
2MIN READ
Learn how to Load development version of assets in production for testing using Requestly. Ensure accurate testing without affecting live data.
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
- 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:
- Open Requestly: Open the Requestly app.
- Create a New Rule: Click on
New Rule
and selectRedirect Rule.
- Enter the Production Asset URL Pattern: Add the URL pattern for the production assets you want to replace with development versions.
- 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
- Example Production URL:
- 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:
Written by
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 .
Contents
Subscribe for latest updates
Share this article
Related posts
Our journey to finding Product-Market Fit
Sachin Jain
December 5, 2024
How Blockthrough uses Requestly to seamlessly test their JS on publisher websites
Sagar Soni
December 4, 2024
The Best Open Source API Mocking Tool for developers (With examples)
Anmol Baranwal
December 2, 2024