Testing iphone web page loads without using the cache

As a volunteer on a club website, I learned that some users could not load the club home page. I had no trouble loading the home page on my Windows 10 PC with any browser. However, when I tested it on my Iphone, I was redirected to another page.

Two HTTP GETs to load the page

If I completely retyped in the url a second time, I got the correct site. Perhaps the second HTTP GET took advantage of some cached resource either on the server or the browser left over from the first HTTP GET.

My goal was to rewrite the web page so that it loaded the first time. However, once the correct page was loaded into the cache by a second HTTP GET,  I could no longer test changes. I needed to empty the cache on my Iphone.

Emptying the cache on an Iphone

Although, there are several ways to empty the cache on an iphone, I found the easiest way is to open Settings > General > Reset > Reset Network Settings. This will empty the cache, while also removing your network settings, such as your WIFI connection that you can then reset.

Once you have emptied your cache, you can tweak your website code to locate the problem that is causing  your page not to load fast enough on the Iphone. Then test with an empty cache.

Completely retyping URL vs Reload button

When first encountering this situation, I noticed that after I got the redirected page, each reload after that also gave me the redirected page.  However, retyping the URL gave me the correct page.  It appears that the first HTTP GET to the page had been converted to an HTTP POST to the redirect page or possibly a different HTTP GET to the redirect page and then been added to the cache. So, each reload pulled a page from the cache that did not match what I had actually typed in the first time and was not identical to retyping the URL. An odd situation.

Leave a Reply

Your email address will not be published. Required fields are marked *