I'm having a problem with the desktop version of my site (MVC4) being served up to mobile devices. I have output caching enabled for my homepage. In the cache directive I have VaryByCustom="Browser" set. I think the problem has to do with the fact that we give users the option to switch to the desktop version of the site.
Take the follow example:
A user comes into the site (www.mysite.com) on a mobile browser and is redirected to the mobile home page (www.mysite.com/mobile).
They then click a link to "View our full site" and are sent to the desktop homepage.
This creates a cache entry for the mobile browser on the default homepage.
All subsequent requests to the default homepage for that mobile browser will be served the desktop version of the homepage from cache.
Does my explanation of what is happening sound correct? If so, how do I fix it without disabling the cache or removing the “full site” option on mobile.
Update 1:
I want to add that I've had this setup for 51Degrees and caching for a long time, but only recently received reports of this problem. I did upgrade from MVC3 to MVC4 in the last few weeks. Could this be related to all the new functionality in MVC4 for browser detection and mobile view rendering?
Related
I have a website developed using Codeigniter & MySql. The website is working fine, however, of late I have noticed that when I hover over the link it shows me the correct page but when I click on it, most of the time it opens a new tab showing some random website. This problem happens on my localhost as well. I have scanned my laptop for viruses/adwares but no infection found.
The url of the website is:
http://reporterpost.in/
Please suggest how do I get rid of this problem. Other websites on my laptop don't have this problem.
Chrome blocked resource <URL> on this site because this site tends to show ads that interrupt, distract, mislead, or prevent user control. Learn more at <URL>
www-embed-player.js:553 Chrome blocked resource https://googleads.g.doubleclick.net/pagead/id on this site because this site tends to show ads that interrupt, distract, mislead, or prevent user control. Learn more at https://www.chromestatus.com/feature/5738264052891648
In my chrome, these alert is appeared in chrome console.
I guessed google adsense is applied to http://reporterpost.in/.
Did you apply adsense to website?
I have a website that is iframed into a 3rd party webpage, which is itself embedded in a WkWebView in an iOS app. Mobile Safari and the WkWebView reject the session (http-only) cookies being sent for my website, breaking basically everything. The work-around in mobile Safari is to either enable all cookies in settings (yuck) or instruct users to visit my site directly (so it counts as a "site I visited", as far as Safari is concerned); neither of these is particularly palatable. I have found no work-arounds for the WkWebView.
This question is two-part:
1) I am thinking of implementing a redirect service in my website, that takes a destination URL as a parameter, and simply redirects the user to that URL on page load. The 3rd party site can then link to my redirect page with the URL set to send users right back, with the hope that this will count as "visiting" my domain, enabling cookies to be loaded.
Alternatively, the 3rd party site could open a new tab to my site, that closes immediately on load. I expect that this would be a less optimal user experience, however, and so would prefer not to go this route.
Best of all would be for the "POST to a hidden iframe" trick (3rd party page POSTs to my domain in a hidden iframe), but as SO questions indicate that trick no longer works.
Are either of these viable solutions, or has Apple blocked these methods of getting the session cookies set as well? Is there a better solution that I have not considered?
2) Is there a way to set the cookie acceptance policy with WkWebViews like could be done with UiWebViews? My searches of StackOverflow suggest not, but the answers I read could be based on older versions of iOS (the app requires iOS 9+).
If there is no app-code solution for WkWebViews, would the solutions for mobile Safari also work with WkWebViews?
I just had a similar issue. I have a WkWebView which loads my web app that has an iframe loading a login screen from a specific server. The login page would complain that the iframe did not allow cookies.
When I would load the login page directly in the web view, it would work and it would also curiously start working as well when I tested it afterwards again inside the iframe.
The best explanation I found for this is, cookies are only allowed to be saved in the iframe if the web view has directly loaded the domain of the iframe at least once. Knowing this, I was able to implement a workaround.
By simply pinging the login page once with the webview, I use the WKNavigationDelegate to wait until I start receiving some data from the server. Once this happens, I make the web view load my page that contains the iframe. Now the iframe is able to consistently load the login screen.
After I installed my APP in Google Chrome, I noticed that if I open the Store in Safari, It show a Install the APP page in my Iframe. I don't want my clients to see that Installation Process. If someone Installed the APP in the Store, I want to check if the Store has Installed the APP and show the Iframe without authentication.
The Iframe query the Price of the Product with Heroku to another API. I use Rails, as shown in the 5 minute APP.
See this image showing the message:
and this one without (desired):
If an iframe works (your information is scrictly informational) then its src attribute should be to a root relative proxy url. The application proxy can return liquid that Shopify will interpret for you.
I am in the process of creating an iOS app with Phonegap and jQuery, however, I am running into issues trying to allow both iFrames (to load normally) and external URLs (to open in Safari). I decided to choose the path of using iframes as I was not able to send POST and open the resulting page in Safari (i was trying to create a mobile friendly login window that opens to the full site in safari).
I recently updated to v1.5 hoping to resolve the issue, but it still occurs.
I have tried the trick "[url scheme] isEqualToString:#"http"...." however this forces any page in the iframe to load in safari.
So, I would like either to have external URLs and iframes to behave just like it does in a Webapp (add to homescreen button on iOS) or be able to send POST to Safari?
Has anyone got ideas? :)
Thanks!
You could change tactic slightly and login fully using your app, but then create an authentication token which would be passed via a standard link to be opened in safari.
You could generate the token new each time. Tokens are a valid system for access.
I switched to the iPhone user agent during which time I visited Google, then I changed back to the default Firefox one again. I cleared all of my history, cache and cookies but Google still thinks I am on a mobile device and insists on directing me to the mobile site. I have checked my user agent and it is definitely the correct one and I have removed every single cookie in Firefox.
How is Google remembering this information? Is there some other sort of mechanism apart from cookies that remembers user settings? It doesn't do it in any other browser.
I've seen some issues such as this on Firefox. Which add-on are you using to change the UA?
To be absolutely sure what the UA String you can Check you User Agent String
Also you can check for cookies using the Fire Cookie Add-On
Normally i can fix this issue by Closing the web browser and starting up a new instance of Firefox.
My other issue with Firefox is that it caches HTTP redirection rules from a website, so if i change a HTTP redirection rule on the server Firefox does not immediately pick this up - This problem is also fixed by closing the web browser.
I solved this problem in firefox by resetting my default agent:
Tools->Default User Agent->Default User Agent
and then going to:
Tools->Clear Recent History->Cache