Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Favicon.ico is not accessible at / #47

Closed
florent-blanvillain opened this issue Feb 8, 2016 · 7 comments
Closed

Favicon.ico is not accessible at / #47

florent-blanvillain opened this issue Feb 8, 2016 · 7 comments

Comments

@florent-blanvillain
Copy link

Hi,

How to prevent favicons and others from being uploaded to s3 ?
My goal is to have /favicon.ico accessible.

Config :

var config = {
  ...
  fingerprint: {
    enabled: true,
    prepend: "https://some-cloudfront-distribution",
    exclude: ['apple-touch-icon', 'favicon', 'mstile', 'android-chrome', 'browserconfig.xml', 'crossdomain.xml']
  },
  ...
};
@LevelbossMike
Copy link
Member

I guess broccoli-asset-rev does not fingerprint .ico files by default. You have to add it to the extensions-array in the fingerprint options. Then your favicon should be fingerprinted correctly and should also have the cdn url prepended.

You can have a look at options for broccoli-asset-revs (the addon responsible for fingerprinting assets for a production build) here:

https://github.com/rickharrison/broccoli-asset-rev#options

After that it should be fine to upload your favicon to s3 and you can also update it, as it will be fingerprinted as any other asset.

@florent-blanvillain
Copy link
Author

But would'nt it be better to let those assets be served by the main domain ?

@LevelbossMike
Copy link
Member

Well that depends what kind of deployment flow you are using. In my case the ember app would be the main domain. Sorry I thought you were having trouble with the fingerprint settings.

If you want to exclude the ico file from the s3-upload you could just remove the file extension from the filePattern option for s3:

https://github.com/ember-cli-deploy/ember-cli-deploy-s3#filepattern

@florent-blanvillain
Copy link
Author

If I exclude *.ico files, ember will just route /favicon.ico to /public/favicon.ico ?
The ember app is my main domain (as I understand it). See : provideup.com

@florent-blanvillain
Copy link
Author

Sorry, as you can see I'm a little lost here :-)
I think the problem is with my node server :-)

@LevelbossMike
Copy link
Member

Ember won't redirect a request for your favicon. The user's browser will just load the favicon based on what's the path for the favicon in the bootstrap index.html that ember-cli creates for you when running ember build. So if you want to show a favicon with a different path as the default you can just change the path to the favicon in index.html and it should work. So just change the path in index.html in your app folder and don't add ico files to your broccoli-asset-rev settings and it should work as you want it to.

Hope that helps.

@florent-blanvillain
Copy link
Author

You're right, indeed Ember has nothing to do with the routing of static ressources !
I think I will use my node server to proxy those ressources to /.
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants