This is a migrated thread and some comments may be shown as answers.

Possible cache issues when using custom rule redirection

2 Answers 24 Views
Fiddler Classic
This is a migrated thread and some comments may be shown as answers.
Neil
Top achievements
Rank 1
Neil asked on 17 Dec 2020, 12:23 AM

Hello everyone!

I'm using fiddler to try and replace one js file with another. I've uploaded the js file to dropbox and created a link to it.

In the Fiddler ScriptEditor, under OnBeforeResponse, I've added the following code:

if (oSession.url==orig_url) { // literal url in code
    oSession.url = dropbox_url; // literal url in code
}

Loading the website that loads the js file I've noticed that no changes were made. I looked at the captured traffic in fiddler and see that indeed a request is made to dropbox_url but the response received is an old version of the file (incorrect Last-Modified header included). Copying the url from the captured request and putting it in my browser does indeed download the new version, so the problem isn't with the url itself.

I tried the Clear Cache button and Disable Caching under Rules->Performance but this odd behavior persists.

Does anyone have any idea why this is happening and how can I fix it?

Slightly unrelated, does anyone have a suggestion for a better approach to what I'm trying to do?

Thanks,

Neil

2 Answers, 1 is accepted

Sort by
0
Neil
Top achievements
Rank 1
answered on 17 Dec 2020, 12:39 AM
I realize now that there is a better way to replace JS files using AutoResponder, but I still am confused as to why fiddler behaves in this way when redirecting the js file request.
0
Nick Iliev
Telerik team
answered on 17 Dec 2020, 07:01 AM

Hello Neil,

 

Is the streaming mode enabled?

    // If a given session has response streaming enabled, then the OnBeforeResponse function 
    // is actually called AFTER the response was returned to the client.

Apart from that, you should really use the Auto Responder for mocking server responses. It is a really powerful tool that is pretty easy to use.

 

Regards,
Nick Iliev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Fiddler Classic
Asked by
Neil
Top achievements
Rank 1
Answers by
Neil
Top achievements
Rank 1
Nick Iliev
Telerik team
Share this question
or