bootstrap.min.css loading is very slow if internet is disabled - twitter-bootstrap-3

I just noticed this weird behavior in my Codeigniter 3 site. This is my HTML head from the home page (CI view), of a site I have on a PC wamp server on my local network.
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width">
<title>Login</title>
<link rel="shortcut icon" href="assets/images/favicon.ico">
<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="assets/css/login_style.css">
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/dimmscreen.js"></script>
</head>
I access the site on my local network. When I have an internet connection the site loads instantly. When I unplug the internet from the router, the site is slow and takes about one minute to load.
If I don't try to load the bootstrap.min.css resource and disable internet, the site is also fast. As you can see, all of the resources i use are stored in a local assets folder. I don't need anything from the internet.
So why is bootstrap.min.css causing the slowdown? Is it something connected with the path of the resource?

found the problem, bootstrap.min.css was trying to access some fonts on the web
https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,700

Related

Unable to scrape parts of a page webpage with scrapy

I'm using scrapy to crawl an e-commerce website I'm experienced with simpler websites where scrapy alone or with splash/selenium handle most cases.
I have a new situation where I have no experience to deal with. From my investigations it could be like a captcha but without any request to the user.
I've made tests to solve it with scrapy alone, scrapy and selenium with no success.
With my scrapy request I receive the following response
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Challenge Validation</title>
<link rel="stylesheet" type="text/css" href="/_sec/cp_challenge/sec-2-9.css">
<script type="text/javascript">function cp_clge_done(){location.reload(true);}</script>
<script src="/_sec/cp_challenge/sec-cpt-int-2-9.js" async defer></script>
<script type="text/javascript">sessionStorage.setItem('data-duration', 5);</script>
</head>
<body>
<div class="sec-container">
<div id="sec-text-container"><iframe id="sec-text-if" class="custmsg" src="https://beta.elcorteingles.es/sgfm/statics/eci_non_food/contents/cc/cca.html"></iframe></div>
<div id="sec-if-container">
<iframe id="sec-cpt-if" class="crypto" data-key="" data-duration=5 src="/_sec/cp_challenge/ak-challenge-2-9.htm"></iframe>
</div>
</div>
</body>
</html>
With the chrome inspector i see also noticed two GET requests (non-java) that might be related:
check -> returns HTML ( ... <title>RP iframe</title> ...)
check-session?origin=https%3A%2F%2Fwww.elcorteingles.es -> returns HTML (...<title>OP iframe</title>...)
Using scrapy shell with view(response) it looks like a captcha situation, waiting for something. Page example could be:
scrapy shell "https://www.elcorteingles.es/supermercado/0110120903000022-coosur-aceite-de-oliva-intenso-1-botella-1-l/"
The title 'challenge validation' suggests it. I have no idea how to handle with this case. From research, I've seen solutions involving scrapy middleware but for cases where input was asked from the user. I found no example similar to this case. Any guidance on how to proceed is appreciated.

Pages does not render properly in IE 11 when using the bootsrapv3.0.0 theme

I have a very simple XPage with a table and some input fields.
The application uses the bootstrapv3.0.0 theme and the OpenNtf bootstrap4Xpages plugin released on 2014-01-28.
I think I'm using correct markup according to bootstrap-3 documentation.
The page renders just fine in Chrome, but it's a mess in IE 11.
In IE the table seems to get cut at a fixed width of approx. 100px and the characteristic blue border on selected “bootstrapped” input fields does not show up as it should
Buttons styled with btn-warning display as expected, also in IE. This tells me that at least some of the styles is applied correctly in IE as well
Anyone else who have run into this problem?
Any tips on a possible solution (dropping support for IE is not an option)?
Are you running IE11 in compatibility mode? Try turning off compatibility mode and see if the site loads.
By default intranet sites load in compatibility mode, which I think really means your web site is going to look awful if it was made in the last 15 years mode.
Per Henrik Lausten has an xSnippet that can display a warning to your users if they are running like so. http://openntf.org/XSnippets.nsf/snippet.xsp?id=display-warning-message-if-internet-explorer-uses-compatibility-view-mode
Add x-ua-compatible header in your html header to disable IE so-called compatibility mode:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
More info in this question:
What does <meta http-equiv="X-UA-Compatible" content="IE=edge"> do?
I was having formatting issues and got fixed by adding
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
I recommed you use these lines before </head>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
I know they are only for IE 8 IE 9 but still :)
I never encounter any problem with IE 11 can you provide any link if possible

Permalinks vs pretty URLs

Let's say i have a simple blog engine. I've posted a simple post with URL
http://example.org/blog/awesomr-post
Few days later i've noticed the typo and fix my URL
http://example.org/blog/awesome-post
But search engines have already indexed "awesomr-post" and if somebody follow this link he'll get 404 error. There is the same issue with bookmarked pages.
So i think the post should be accepted by two links
http://example.org/blog/awesome-post
http://example.org/permalinks/1
Now i have to specify relationships somehow. What i can do
http://example.org/permalinks/1
<!DOCTYPE html>
<html>
<head>
<link rel="canonical" href="http://example.org/blog/awesome-post">
</head>
<body>
page content
</body>
</html>
http://example.org/blog/awesome-post
<!DOCTYPE html>
<html>
<head>
<link rel="bookmark" href="http://example.org/permalinks/1">
</head>
<body>
page content
</body>
</html>
Is it right solution? And should i use the canonical or permalink URL when linking from another site pages?
One of the way is to have 301 (permanent) redirect from http://example.org/blog/awesomr-post to http://example.org/blog/awesome-post

Sniff and modify URL requests coming from UIWebViewController

I have one html page open inside UiWebViewController with cordova. While index.html loading inside the Uiwebviewcontroller can we sniff the requests that is originating from index.html?
for example I have following html that is getting opened in UiWebviewcontroller:
<html>
<head>
<link rel="stylesheet" type="text/css" href="theme.css">
<script src="app.js"></script>
</head>
<body>
<img src="img.jpg"/>
</body>
</html>
Can I sniff and modify the url that is getting requested inside Uiwebviewcontroller ie. img.jpg,theme.css,app.js to something like content/img.jpg, css/theme.css, js/app.js using Objective-C.
Yes, that’s possible using NSURLProtocol, see this blog post by NSHipster and this related Stack Overflow thread.

How to display a favicon for web app using Tomcat? [duplicate]

This question already has answers here:
How to add a browser tab icon (favicon) for a website?
(13 answers)
Closed 6 years ago.
Does anyone know how to implement a favicon icon for a particular application using Tomcat? This icon file would not be for all webpapps, just this one on the server in question.
Just add the following code in the <head> to your index.html in you webapp/projectName/
<link rel="shortcut icon"
href="http://example.com/myicon.ico" />
I like to add that the original tag type for the link was "shortcut icon", but that didn't
conform to the standard so it was sort of switched to "icon".
So I recomend add both to your head block:
<link rel="icon" href="http://www.example.com/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="http://www.example.com/favicon.ico" type="image/x-icon">
Also some browsers don't support sizes other than 16px X 16px.
Delete or rename tomcat/webapps/ROOT/favicon.ico and Tomcat will look for a favicon.ico in the root of each web app that it serves. You don't need to put a into the head section of each page.
<link rel="shortcut icon" href="http://example.com/myicon.ico" />
add that within the <head> of your page - where the .ico file is an icon - there are several websites (use google) that generate .ico files from pictures (gif / jpeg etc)