Application Running With SSL not loading all scripts/CSS on first visit - javascript

Hopefully this isnt a tricky one. I've got a web app that doesn't load all javascript/css/images on the first visit. Second visit is fine.
After approximately 2 minutes of inactivity the problem reoccurs.
These problems only started occuring after the customer requested SSL be applied to the application.
Ajax requests stop working after 2 minutes of activity despite a successful page load of all javascript elements.
Application timeout is 30 minutes - like I said, everything was fine before SSL was applied.
All javascript and CSS files use absolute URLS - e.g https://blablabla
There appears to be no pattern as to why certain files arent loaded. The firebug Net output shows the status for the failed elements as 'Aborted'. For example, site.css and nav.css are in the same folder, are declared after each other in the head tag yet one is loaded and the other is not. Both will load fine after refreshing the page (unless roughly two minutes have passed).
An Ajax request also shows as aborted after two minutes. However, if i do the request again the Ajax request will succeed. Almost as if the first request woke something up.
None of these problems occur in Chrome
Any ideas? :)
FYI this is a .Net 4 C# MVC app running under IIS7 but I'm not sure its relevant since it works in Chrome. Everything worked fine before SSL was applied.

Removed SSL across the board and secured action methods with [RequireHttps]. Then changed the scripts and CSS in the master files to point to absolute HTTP urls. Javascript then worked fixing the ajax.
If anybody has any idea why CSS/Javascript broke over SSL it would be cool. Im guessing it's perhaps the work load? Since it worked the second time I'm guessing half the CSS and scripts were cached making less of a workload over SSL?
Anyway, working now!

Related

403 errors on .js and .css files on first load, solved on refresh

I am hoping someone can help.
I have an issue with pages on my website returning 403 errors on some .js and .css files and images on the first load - visible in the Chrome inspect console. This causes the page to render improperly. Oddly, all the issues are resolved on a page refresh.
If I do a hard refresh, the problems reappear, if I do a normal refresh they are resolved.
I have put hours into this, but I think it may be an issue with the server/IIS, since the exact same page served from a different machine has no issues at all.
A test page on the live server that shows the errors is here: https://www.zygology.com/store/pc/web_test3.asp
The exact same page served on the test server and showing no errors is here: http://test2.zygology.com/store/pc/web_test3.asp
The actual homepage on which the errors are also visible is https://www.zygology.com and the test website showing no errors is http://test2.zygology.com
To see the issue, open the inspect console and see the 403 errors returned on the scripts that are trying to load. It happens on all browsers.
Both the live machine and the test machine are running Windows/IIS
I would be grateful for any help that can be offered.
Thanks
I had this issue in IIS 8.5 when we moved to a new server. The issue was that the IP Address and Domain Restrictions module had been installed on the new server and it was limiting concurrent requests to 5. If you have that module installed, double click it and select "Edit Dynamic Restrictions" on the right menu. In the resulting dialogue, make sure the 2 "Deny IP Address..." check boxes are cleared or that the settings are appropriate for the number of requests you expect to receive concurrently or over a period of time.

Loading time more in Iphone safari

I am trying to load my web page in mobile(IPhone), In chrome browser it taking only 3 seconds but in safari it taking almost 2 minutes to load a entire page, Is there any specific reason for this behavior? If is it so how can I overcome this?
If I had a link to your page I could tell you exactly what is causing the problem.
The second biggest issue with mobile carriers is the number of simultaneous requests allowed. A desktop will download about 6 page resources like CSS, JS, and images (http requests) simultaneously. Mobile, one, maybe two.
The biggest issue is the tower will often drop the radio signal between the phone and the tower between each request. It takes about 2 seconds for the phone to reestablish the connection with the tower.
With mobile it is very important to minimize the number of http requests per page.
You want to make sure your http response header contains a Content: keep-alive for each http request.
Do not have unused CSS selectors.
Much the used CSS is inefficient and bloated by use of over qualified selectors.
Most web pages have multiple CSS files linked in, most unused. Most pages only require a small amount of CSS which could fit withing the pages <head><style> rather than being linked in.
There should never be more than one CSS file.
Javascript should not be used to layout the page. All JS does for layout is alter the HTML and CSS that should be have been done by the page designer. When JS is needed, it should be loaded after the page renders.

Javascript timer puzzle

This is a weird scenario I just experienced and I am not sure how to phrase the question.
It may be best to describe my application and what it does 1st.
I have an IP camera connected to my router.
I use a C# VLC wrapper to get 10 frames a second using a RTSP protocol.
I then upload to my web server using a [web method] these seperate jpegs to my server.
Then via browser using a javascript timer set to 100ms it renders the image into a HTML image control by calling an ashx page repteadly.
Now this has worked for a few days OK.
Now this is what I have experienced in the last 48hrs.
The images coming from the IP Camera was jumpy. That is to say sometimes the images flow in a timely order and sometimes it will slow down, stop and speed up again to 'catch up'.
I noticed when viewing via a web browser client on another PC on my network that the javascript timer calls were slow and sometimes stopped for periods of time. I used Google Chrome to view how often the ashx url was being called.
I closed down my own applications. Rebooted all my PCs and started VLC application without using the wrapper. Again, the flow was 'jumpy'. So the conclusion there was that it was not my application.
For some reason I decided to log into my router (192.168.0.1).
Page was not found.
In fact I had to do a complete restart of my router to be able to access my router 'page'.
As soon as I did this everything worked OK again.
So, the 2 questions I have is (1) why could I not access my router through that IP address and (2). Why was my javascript timer crashing to a stand-still?
Like I said this is a weird scenario and I would not blame anyone for wanting to close or vote down this question.
But on the off-chance this is a known thing I would like to be educated.
Thanks

Wordpress returning half a response

Running out of ideas that could be causing this issue so just thought I would throw it out there.
I am currently developing a site based on Wordpress which has some search functionality powered by a web service. The web service returns a load of details of various residential properties, including absolute image paths which I am requesting and caching on first request.
I embedded RoyalSlider into the page to display the images in a form of gallery. This works brilliantly locally, but the issue I am seeing is when I stick the site onto a staging server. My page just fails silently whilst loading, halfway through loading my RoyalSlider thumbnails. I have checked the raw response from the server and indeed it appears that the response just stops halfway through loading all of my RoyalSlider images. But its a 200 response, no 404's, no console errors, nothing.
Oh and I should mention that if I set a break on my loop which renders my markup, i.e limit it to say, 10 iterations, the problem does not persist and the entire page loads (albeit with only 10 of my images loaded).
Does anybody have any idea what would cause something like this to happen?
Thanks in advance
The main cause of this issue was a difference in PHP versions. This should have been one of the first things I checked, as I was seeing problems in one environment and not in another - I had just complacently assumed I was on 5.3.
The php version on my staging server (5.2) seems to have had some kind of issue with my caching layer - although what that was exactly is still unclear (leaning toward something to do with output buffering as suggested above). Updated the php version on staging though and that appears to have fixed my issue.
Thanks for the ideas Adam!

Simulate loading on localhost

I have a site which uses AJAX and preloaders. Now I would like to see the impact of these preoloaders before deploying the site online.
The "problem" is that localhost doesn't have loading time and the response is immediate, so that I can't see my preloaders.
How can I simulate loading or limited bandwidth (with Firefox, Rails or whatever else)?
If on windows, download Fiddler and set it to act like you are on a modem:
Tools-->Performance-->Simulate Modem Speeds
[edit]
Since you said you are now on a MAC, you have Charles which has throttling
[/edit]
I don't have a rails app in front of me right now but why don't you just add a delay to the appropriate controller?
i.e.
def index
# ...
sleep 2 # sleeps for 2 seconds
# ...
end
Alternatively, use a debugger and place a breakpoint in the controller code. This should mean that your preloader will show until execution is continued.
One option would be to deploy the site briefly to the host you will be using for production under an alternate URL for performance testing.
However, the way it performs for you won't necessarily be the same for everyone else in other locations.
If you provide some more detail on what these "preloaders" are and how they work and what you mean by "see the impact" we might be able to give better answers. Do you mean you want to eyeball the AJAX spinner gifs and get a feel for how it will look to the end user as the loading takes place? Or do you mean you want to do some kind of formal benchmarking on them?
You can use Firebug plugin to Firefox to determine the network behavior of your page. This works fine for localhost. You should see all images being retrieved simultaneously at the time of the preload execution.
You could configure your router so that it forwards requests on a certain port to the computer you're running the website on. Then, when you open your.ip.add.ress:the_port in your browser, the bottleneck will be your upload speed, which is generally quite low.
But that's just how I would do it ;)

Categories