How to disable cache on IOS safari? - iphone

Is there a way to disable caching on ipad/iphone? I want to run some automated tests for non-cache experience.

I just stumbled across a way to disable cache in Safari on iOS:
iOS
Open Settings
Navigate to Safari > Advanced
Enable Web Inspector
Switch back to Safari and load a web page
Desktop
Open Safari
Navigate to Safari > Preferences > Advanced tab
Enable the Develop menu
In the Develop menu, select Your iOS Device Name > The Page You Want to Debug
Press Command-Shift-R to reload while disabling cache
Bonus: This is a full Web Inspector on your computer inspecting a page on your iOS device
If you want something more permanent, you'll either have to go the proxy route or make a UIWebView/WKWebView wrapper app that disables caching.

I could be wrong, but on iOS does putting Safari in Private Browsing mode disable cache?

There is a way to effectively disable caching on iphone/ipad/IOS.
Install Fiddler on a windows desktop, and allow remote computers to connect:
In IOS, setup a proxy under your wifi connection settings, pointing to to the IP address of the computer you are running fiddler on, and on port 8888 (assuming you haven't changed it from default in fiddler):
By now, fiddler should be intercepting all web requests your device is making.
You can now disable caching from the Rules -> Performance menu in fiddler.

Doesn't seems like possible. On desktop safari, there is a option to disable cache in developer tools, however there isn't one on mobile safari. I didn't find the option in other browsers like opera neither.
If you wanna try, you can overwrite a desktop firefox's user agent string and make it a fake ipad mobile browser, and then disable cache. But that will depends on what you want to test and it could not work at all.
Hope this helps.

In the newest MACOS doesn't work anything to "full reload" content to me. Debug isn't really something pleasure.
After connect desktop Apple Safari with iPhone or iPad - it should work ALT+CMD+R - but not for me.
The newest trick is
hold CTRL+SHIFT
and CLICK not touch, to icon "Reaload page"
Maybe help someone.
Thx for inspiration
https://stackoverflow.com/a/24129161/1347601

Using iOS Simulator 9.0 I have been finding that both the Developer - Disable Caches menu item and Cmd-Shift-R reload have both failed to completely bypass the cache for whatever reason. The only thing that worked was to hold shift and press this reload button in the Safari Developer tools:

Related

What browser opens a PWA when it is launched from home screen app icon

I am examining PWA and Web Components technologies recently. As far as I have learned now Web Components is a new suit of tech,
Custom Elements, Shadow DOM, HTML Templates and HTML imports. Together with those Web Components enabling techs Web App Manifest, Service Workers, and certain performance improvement techniques used to make what is called as Progressive Web Applications.
What I wonder is when one "Adds to Home Screen" an application in a certain web browser what is the browser that opens it when it is launched from its home screen icon? Is it the browser it has been added to home screen from, or it is the default browser of the system no matter which browser it has been added to home screen from, or it is just a generic web view available on the host operating system at the moment like the one used in native web applications?
Lastly, is it possible for a developer coding her/his app to choose one?
Currently, for me, these combinations open a new "Standalone" window
I believe Android/Chrome is the only one that installs a WebApk
All the others are just shortcuts to open your website in that browser without the normal browser navigation items
I know of no options for the developer for how the shortcut opens your PWA
Android 8.10 - Chrome 67
Android 8.10 - Chrome (beta) 68
Android 8.10 - Edge 42
Android 8.10 - Opera 43
iOS 11.4 (simulator) - Safari
As test I created app shortcut of site https://pwa.rocks from browser:
Brave
Firefox
Chrome
and found that there were 3 different shortcut created for each of the browser. Launching each shortcut resulted in opening the respective browser that created it.
I believe there is no way of changing the default browser to launch the app by coding something in the app. I could not find a way of doing that, if someone knows how to do it, I will be interested to know about it
Here is similar question: What browser will PWA (Progressive Web App) use after adding to home screen?

Use desktop webinspector to clear cache in mobile safari?

Is it possible to clear mobile safari cache using the desktop web inspector in Safari?
I know I can go to the settings in the iphone, but it's a bit of a hazzle and since the phone already is teathered to the computer while debugging, it would be really nice if I could clear it thourgh the webinspector in safari.
You can use Cmd + Option + R while in the developer tools web inspector to force mobile safari to reload its cache.
I had another problem which was that Fiddler also has a cache. I also had to clear that as I was running the iPad through the fiddler proxy.
Once I cleared the fiddler cache, and then used Cmd + Option + R, I could see the iPad requesting and receiving the new files.
I came across this issue with safari 11.1, and the answer was really simple. There is actually a button on the right top corner of the network tab to disable caching when debugging. I thought about leaving this just in case someone else miss the button just like I did. ( the one in blue )
I'm using Safari 11.1 on a macbook, and using Web Inspector connected to an iPhone with iOs 11.2.6.
From the Web Inspector, if I use the key board short cut: OPTION + COMMAND + R, it both clears the cache and reloads the page.
Well, there is an option for this in the Develop menu - however it doesn't appear to work.
A simple way around this is to add a new parameter to your url
eg. http://domain.com/testing.html?refresh=1
(of course having the functionality working in Web Inspector would be better)
Old thread but if you have your iphone connected to your desktop developer tools, you can hit OPTION + CMD + E (shortcut for empty caches) while viewing the web inspector that is connected to the iphone. Then hit the refresh button in your iphone browser.
Make sure you are really connected (Develop > Your Phone Name > The Website being viewed on phone) It should show on your desktop developer tools dropdown menu.
Safari 11.1
High Sierra
ios 11.4
Try Cmd+alt+R when iPhone is connected and your inspecting with developer mode. It worked for me!
Nothing here worked for me on iOs 11.4.1. After digging around in the network tab I found Command + K which is "Clear Network Items". I hope this helps someone.
You can connect your iPhone to a MacBook via USB and use the Safari Web Inspector
Once you are connected, you can use Develop -> Empty Caches.

How can you test conditional CSS meant for an iPhone on a desktop browser like safari, chrome, or firefox?

Specifically, the "max-device-width:" condition
If you're on a Mac, you can use the iPhone simulator that comes with XCode. I've also used a Firefox add-on called "Modify Headers" and I send iPhone headers, however, that may not help much with max-device-width.
For mac or PC, if you can upload your files to any temporary server, you can check the results online in TestiPhone: http://www.testiphone.com/
This is a web browser based simulator for quickly testing your iPhone
web applications. This tool has been so far tested and working using
Internet Explorer 7, FireFox 2 and Safari 3.
The firefox plugin Developer toolbar let you change the browser size with just one click to the device size. I bet there is plugins like that to the other browsers. If you can't find that to all browsers then I suggest that you just upload your code to a server and surf to it using an iPhone.

Is there a way to test a web site on the iPhone without an iPhone?

I want to test a website to see how it works with the iPhone but I don't own an iPhone or an iPod touch. Is there a way I can test how the site works on them without owning one?
What I'm really after is fixing how Stackoverflow's WMD markdown editor works on the iPhone. I hear that the hyperlink and image prompts are created too high. I think I know how to fix that but it's pretty tough to develop blind.
If you own a Mac, you can download the iPhone SDK which comes with an iPhone simulator. It works not only for debugging a native app but also for browsing the web.
If you have Safari on your computer, you can enable the "Develop" menu under Preferences > Advanced > Show Develop Menu in Menu Bar.
With this enabled, you can go to Develop > User Agent, and change the user-agent string to the device you want your browser to report to the web server as.
By resizing the window to the appropriate width, you can emulate what the site will look like on the iPhone.
The upside of this is that it's quick, it works on both Windows and Mac, and you don't need the iPhone SDK installed. You can also browse iPhone-specific versions of websites that catch user-agent strings directly from your PC.
The downside is obviously your Safari browser on your PC will behave quicker than on the actual device (especially in regard to javascript performance); it displays plugins and shows fonts that may not be available on the actual iPhone OS; a lack of multi-touch support and "snapping" to columns while scrolling; no auto-rotation; no multi-touch/pinch-zoom; widgets will look different; etc.
Just a notice on this old thread - we have now enabled live testing on iPhones and iPads via vnc at CrossBrowserTesting.com.
Ken - Founder
There is a free app on the mac that emulates the iPhone browser: iPhoney
I don't purport to have done more than a web search, but the problem seems to be solved by several products that are "iPhone web app emulators."
http://www.testiphone.com/
http://marketcircle.com/iphoney/

What debugging techniques do you use for iPhone/iPod web development?

I'm working on a web application, and we are targeting the iPhone and iPod Touch. I'm familiar with the debugging tools for FireFox and IE (e.g. Firebug and IE Developer Toolbar), but I can't find anything for the iPod. I am not looking forward to using alert as my main debugging tool, especially when I expect mouse events to be one of the major issues.
Is this really the state of the art? What tools do you recommend?
Also, how similar is the html layout on an iPhone to that of Safari running on Windows? On a Mac?
The iPhone version of Safari includes a debug console that can be very handy. Settings > Safarai > Developer.
You can also use the Simulator in the iPhone SDK. There's no extra debugging, but it's easier than using a physical device all the time.
You can also use the desktop version of Safari for many things.
The web tools that target the iPod Touch and iPhone arenas include
[iPhone Remote Debug Console](
http://code.google.com/p/iphonedebug/)
BlackBaud Simulator for Windows
[MobileSafari Simulator](
http://www.testiphone.com/)
[iPhoney](
http://marketcircle.com/iphoney/)
While WebKit has a remote inspector, it is hard to enable on an actual iOS device (at least without jailbreak) and so most tools for it are simulator-only. iWebInspector looks promising for this, but keep in mind the simulator's WebKit library is not identical to the device's.
That's where weinre comes in. With weinre, you can "debug a web page displayed on your phone from your laptop". How it works is you run its custom HTTP server that hosts two things:
a JavaScript file you include on the page you want to debug
an Inspector page that you load on the machine you want to debug from
You start the server e.g. java -jar Downloads/weinre.jar --boundHost -all- --httpPort 4242 and then put a script tag like <script src="http://weinre-server-name.local:4242/target/target-script-min.js"> in the source code for your webpage and load the inspector by navigating to e.g. http://weinre-server-name.local:4242/client. When you load the target page on an iPhone on your local WiFi connection, the connection will show up in the client page on your mainframe and you can use the Inspector tabs to view/edit the page on the iPhone.
It has some limitations (no Javascript breakpoints and such) and can be a little laggy, but overall it's pretty magic.
There is also a nice tool called iWebInspector
http://www.iwebinspector.com/