PDA

View Full Version : [CLOSED] CDN problem. CDN turned on but only loads CDN when browsing from the same machine. Remote client turns CDN off.



michaeld
Oct 22, 2013, 9:43 AM
So this issue is kind of strange. I turn CDN on my production server. Thank you for releasing 3.2.1. It gave me enough of the fixes required to try CDN again. However, when I launch the browser from remote to my production server. All extnet pages are loading from embedded instead of CDN. However, when I run the browser from the production machine, CDN works fine. I also cannot reproduce this behavior on my development box. CDN works but again, from the same machine as the IIS server).

So this gets me to thinking maybe something new in the new ResourceStrategy implementation that switches out of CDN mode under certain conditions which fail. On the Development machine, I stepped through but I'm in the correct CDN path. Are there possible others conditions? I remember we discussed turning it off if in Secure mode. I'm not in secure mode so I know it's not that. Any other possibilities?

Daniil
Oct 22, 2013, 1:42 PM
Hi @michaeld,


So this gets me to thinking maybe something new in the new ResourceStrategy implementation that switches out of CDN mode under certain conditions which fail.

If a custom ResourceStrategyType is defined, then everything is under its control.


CDN turned on

Please clarify what exactly do you mean? That you are using a custom ResourceStrategy as here:
http://forums.ext.net/showthread.php?25367&p=118911&viewfull=1#post118911

If so, are you not able to debug requests from a remote machine? Maybe add some logging in the GetUrl method of the custom ResourceStrategy class?

A weird issue. I have no idea how a client (I mean browsers on a production server and on a remote machine) could affect it. It seems everything here should be controlled on the server level.

michaeld
Oct 23, 2013, 4:04 AM
If a custom ResourceStrategyType is defined, then everything is under its control.


Except, my understanding of reviewing that code is it returns back to default if you return Null.



Please clarify what exactly do you mean? That you are using a custom ResourceStrategy as here:
http://forums.ext.net/showthread.php?25367&p=118911&viewfull=1#post118911

If so, are you not able to debug requests from a remote machine? Maybe add some logging in the GetUrl method of the custom ResourceStrategy class?

A weird issue. I have no idea how a client (I mean browsers on a production server and on a remote machine) could affect it. It seems everything here should be controlled on the server level.


Yes, I am using the resourcestrategy I defined in the thread above from the post dated 10/10. I return null if it's not an extjs resource which returns control back to the default resourcestrategy. I've walked through this code a few times all the way into Resource.cs. My resource strategy works. The default strategy correctly loads extnet from the CDN. When I step through on my development machine, the ResourceLocationType is correctly defined CDN.

So, I conclude, the only way this could be failing on the server-side is if somewhere else in the EXT.NET code, RenderStyles == CDN and RenderScripts == CDN is being overridden because of some condition and set back to Embedded.

Like I said, when I run the browser directly from the production machine to the production machine, cdn is being correctly loaded. When I use my client browser from my development machine to the production server (that is, I use my domain where I host my site), extnet resources resolve back to ext.axd.


I did a search for all instances of RenderStyles and RenderScripts in the ext.net code, and there are a lot of conditions where it assigns, but because I cannot reproduce it on the development machine, I don't have a lot to go on. I'll attempt to put some logging, but I suspect I'm just going to confirm what I've said above. I'll identify that is it being overridden, but not be able to tell you where or why in the ext.net library.

michaeld
Oct 23, 2013, 4:35 AM
Current assumption is it issue may occur in ResourceManager.DetermineRequiredResourceMode. This code overrides the ResourceLocationType.

Nope, I published with a remark in this section to no avail.

Daniil
Oct 23, 2013, 6:25 AM
If a custom ResourceStrategyType is defined, then everything is under its control.


Except, my understanding of reviewing that code is it returns back to default if you return Null.


Well, yes. I thought you get this CDN => Embedded swing for the ExtJS resources which you control in your resources strategy.

Ok, just to clarify/summary:

With a browser on the production server all the resources are loaded from CDN according to your resources strategy and RenderStyles="CDN" and RenderScripts="CDN".

With a browser from a remote machine all the resources are loaded as embedded disregarding your resources strategy and RenderStyles="CDN" and RenderScripts="CDN". Or not all? Just non-ExtJS ones? So, does the custom strategy still work for ExtJS resources and only Ext.NET resources are loaded as embedded?

michaeld
Oct 23, 2013, 1:15 PM
With a browser on the production server all the resources are loaded from CDN according to your resources strategy and RenderStyles="CDN" and RenderScripts="CDN".

Yes, extjs resources come from extjs.cachefly.net. All extnet resources come from speed.ext.net.


With a browser from a remote machine all the resources are loaded as embedded disregarding your resources strategy and RenderStyles="CDN" and RenderScripts="CDN". Or not all? Just non-ExtJS ones? So, does the custom strategy still work for ExtJS resources and only Ext.NET resources are loaded as embedded?

Extjs resources come from extjs.cachefly.net as per my resourcestrategy. All extnet resources come from my host as ext.axd.


However, now I'm beginning to think there is something very wonky with my production server. It thinks its in secure mode when it's not which would explain why the embedded resource mode is being turned on because I check IsSecure to determine embedded or cdn. How this is even possible I'm at a standstill. We're 3 days late as it is and this issue is brain-numbing. We're also seeing redirects going to secure pages when they should not. I'm beginning to think these issues are related.

michaeld
Oct 24, 2013, 12:41 AM
You can close this issue. It turned out to be the firewall. I finally got our IT guy to regard this issue as something internal not code.