You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Friday, March 21st 2014, 12:13pm

CORS on Cloudfront help

Is anyone having any success using amazon cloud front to serve virtual tour jpg tiles? I've had it working fine for a few days and then it stops sending the correct header on some assets. The errors are totally random and only seems to effect some tiles from some tours, if left for a few days they start working again.

This is the CORS policy I'm using.


<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedHeader>Content-*</AllowedHeader>
<AllowedHeader>Host</AllowedHeader>
</CORSRule>
</CORSConfiguration>

Has anyone got this working?

Thanks

Will

olihar

Trainee

Posts: 140

Location: Iceland

Occupation: Interaction Designer

  • Send private message

2

Friday, March 21st 2014, 12:40pm

I have tried multiple times, and come to the conclusion there is no CORS support on CloudFront, it is only on S3.

It sometimes works and other instances it does not, it all seems to be from where the tiles are server from.

3

Friday, March 21st 2014, 12:56pm

Thanks Olihar, I've drawn the same conclusion that CORS is not working consistantly on CloudFront and S3 is the only option. This post is my final attempt to make it work as I've tried everything else.

It would be a great shame not to take advantage of a CDN, there must be a solution or alternatives…. *confused* *question*

olihar

Trainee

Posts: 140

Location: Iceland

Occupation: Interaction Designer

  • Send private message

4

Friday, March 21st 2014, 1:24pm

I have been reading about this, many are complaining...

and I have heard that CORS does indeed work if you feed CloudFront content from any other place then S3. Dont know if its true.

So S3 > CloudFront with CORS does not work.

5

Friday, March 21st 2014, 2:41pm

Official Response from Amazon Support Forum: Posted on: Jan 8, 2014 4:48 PM "Sorry, CloudFront currently doesn't support CORS. We recently updated the Amazon CloudFront Developer Guide to mention this under "Request and Response Behavior for Amazon S3 Origins":

http://docs.aws.amazon.com/AmazonCloudFr…#RequestS3-cors"



Are there any other options to use Krpano on a CDN?

Thanks

Will

This post has been edited 1 times, last edit by "iamwill" (Mar 21st 2014, 2:52pm)


6

Friday, March 21st 2014, 3:06pm

Have you tried Cloudflare?

7

Friday, March 21st 2014, 3:18pm

I also use cloud flare but it's not really a CDN in the same way.

olihar

Trainee

Posts: 140

Location: Iceland

Occupation: Interaction Designer

  • Send private message

8

Friday, March 21st 2014, 4:47pm

I have been interested in CloudFlare, has anyone tried it for KrPano tiles?

9

Friday, March 21st 2014, 6:28pm

Cloudflare is useful for all sorts of reasons but it's not really a CDN. It does cache pages and can share some of the server load (25% ish) on a busy site. It's best features are related to security IMO.

This post has been edited 1 times, last edit by "iamwill" (Mar 21st 2014, 7:04pm)


jplf

Beginner

Posts: 5

Location: France / UK

  • Send private message

10

Friday, March 21st 2014, 7:19pm

I have been using Cloudflare for a few months to host panos / images. So far there have been no problems.

This has been done a) for speed and b) to ease development as the panos / images are separate to and independent of the main site.

The main site is hosted on a regular ISP and one directory is redirected to Cloudflare. The cloudflare content also has its own domain name which makes it easy to test panos out before putting into the main site.

Here is an example:

The pano on Cloudflare http://panospaces.com/panoramas/ch_chalon_i/ch_chalon_i.html
The "calling" page on the main website ( *rolleyes* in development !) http://www.jplf.com/wp/2014/03/chateau_chalon_i/ which is hosted on a regular ISP.
All of the content on the page is generated with wordpress and the pano is called via the PanoPress plugin which is directed to the content on Cloudflare.

11

Friday, March 28th 2014, 2:50pm

Hi,

I'm using too CloudFront, e.g. for all panos here:
http://krpano.com/html5multires/

see:
http://krpano.com/panos/tokyo45gp/tokyo.xml

but I don't have any problems with CORS...

The only important thing is that the CORS headers are correct.

On my case I'm hosting the files itself on the krpano server and set there the CORS header via a .htaccess file with the following content:

Source code

1
Header set Access-Control-Allow-Origin "*"


CloudFront itself is then loading and caching the files (including the CORS header) from the krpano server and serving the cached files via the CDN network.

Best regards,
Klaus

olihar

Trainee

Posts: 140

Location: Iceland

Occupation: Interaction Designer

  • Send private message

12

Thursday, April 3rd 2014, 6:03pm

Yes indeed CloudFront works like a charm when you feed tiles from anything else then S3. It is S3 > Cloudfront using CORS that is broken.

13

Sunday, April 6th 2014, 8:05pm

Hi, everyone;

I was using krpano 1.0.2 version with s3 aws server. Now I decided to renew my site. So I downloaded 1.17 version. I am trying to use same ways but gettin xml reading error 0 on krpano.

Source code

1
2
3
4
5
6
7
8
<script src="http://www.mysite.com/krpano/krpano.js"></script>

<div id="pano" style="width:100%;height:100%;">
	<noscript><table style="width:100%;height:100%;"><tr style="valign:middle;"><td><div style="text-align:center;">ERROR:<br/><br/>Javascript not activated<br/><br/></div></td></tr></table></noscript>
	<script>
		embedpano({swf:"http://www.mysite.com/krpano/krpano.swf", xml:"http://s3-eu-west-1.amazonaws.com/mysite/a_random_panorama/krpano.xml", target:"pano", html5:"prefer", passQueryParameters:true});
	</script>
</div>


When I try on my hosting what has the krpano.swf and xml file then i works fine. But if I use external xml file it gives error. Is there any way to fix ? Thanks for your help.
Note: When I was using old version of krpano I got same error and could fix using <object> codes. Because flash object codes accepted external xml URI.

Now I am a newbea on new 1.17 and really want to use HTML5 support so I need help. Could I use <object> codes instead of embedpano codes again or not.

Have a good days.

14

Tuesday, April 8th 2014, 7:44pm

Loading tiles from another server HTML5

This is the solution. Many thanks Olihar. I fixed it!
I was using krpano 1.0.2 version with s3 aws server. Now I decided to renew my site. So I downloaded 1.17 version. I am trying to use same ways but gettin xml reading error 0 on krpano.

Source code

1
2
3
4
5
6
7
	ERROR:

Javascript not activated


	
		embedpano({swf:"http://www.mysite.com/krpano/krpano.swf", xml:"http://s3-eu-west-1.amazonaws.com/mysite/a_random_panorama/krpano.xml", target:"pano", html5:"prefer", passQueryParameters:true});


When I try on my hosting what has the krpano.swf and xml file then i works fine. But if I use external xml file it gives error. Is there any way to fix ? Thanks for your help.
Note: When I was using old version of krpano I got same error and could fix using codes. Because flash object codes accepted external xml URI.

Now I am a newbea on new 1.17 and really want to use HTML5 support so I need help. Could I use codes instead of embedpano codes again or not.

Have a good days.