MyBB Internal: One or more warnings occured. Please contact your administrator for assistance.
WebPagetest Forums - How to load code locally?

WebPagetest Forums

Full Version: How to load code locally?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

I was wondering how to load code or graphics locally.

Say for example a pluggin calls for http://www.abc.com/run.js and my website is http://www.naples-fl-real-estate.com/ and I want to run that as http://www.naples-fl-real-estate.com/run.js ..........

Without going into the complex individual scripts, is there a simple way to redirect, say in the htaccess, this file to indicate it's new location is stored locally and not to go out to abc.com to get it?

The idea is to minimize load times and not rely on distant hosts for the information.

Thanks
No, you would either need to rewrite the plugin or use a test script for webpagetest to have to redirect http://www.abc.com to http://www.naples-fl-real-estate.com.

It's not a complex script. Something like this should do it:

Code:
setDnsName    www.abc.com    www.naples-fl-real-estate.com
overrideHost    www.abc.com    www.naples-fl-real-estate.com
navigate    http://www.naples-fl-real-estate.com/
Patrick

The code above, I would put that in the htacess?
Not sure what 'test script for webpagetest' is.

Thanks
Sorry, in the advanced settings there is a "script" tab where you can paste in a webpagetest script (used for more complex testing and multi-page flows).
I still can't see the connection.

I'm guessing from the question posted that storing, say a graphic file locally, cannot be done through any type of redirect to avoid pulling the data from a remote domain.
Sorry, thought you just wanted to see "what if" for testing. To do it for real users you'd have to modify the plugin itself and chances are you'd probably break something by doing it.
Reference URL's