Firebase Hosting support for useragent rewrites?

1,170 views
Skip to first unread message

Stephen DeBaun

unread,
May 19, 2016, 4:35:20 PM5/19/16
to Firebase Google Group
Any plans for firebase hosting to support useragent based url rewrites?

Ive got a SPA built that uses the firebase database, and I've been able to get this far without running an express server, just using a CDN to host... but in order to support the facebook opengraph crawler, i am looking at the prerender.io service.  To use it I basically need to rewrite/proxy requests from certain useragents to the prerender service.

E.g. of a nginx conf that does what I need (but for nginx)

https://gist.github.com/thoop/8165802

Michael Bleigh

unread,
May 19, 2016, 4:48:19 PM5/19/16
to Firebase Google Group
Hey Stephen,

This is not something we're likely going to support in Firebase Hosting -- because prerendering requires server-side processing, you'd have to proxy off to an external URL. We are well aware of the benefits of prerendering and want to bring those benefits to Firebase Hosting, but we'll be looking to address the prerendering issue directly as opposed to supporting the kind of rewriting you describe.

Hope that helps!

-Michael

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/4acc1f0a-24ae-4880-9832-4fc4cd02d8cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Doug Thompson

unread,
Feb 27, 2017, 5:43:40 PM2/27/17
to Firebase Google Group
I wonder if there's any status on this Michael?

Thanks,
Doug


On Thursday, 19 May 2016 16:48:19 UTC-4, Michael Bleigh wrote:
Hey Stephen,

This is not something we're likely going to support in Firebase Hosting -- because prerendering requires server-side processing, you'd have to proxy off to an external URL. We are well aware of the benefits of prerendering and want to bring those benefits to Firebase Hosting, but we'll be looking to address the prerendering issue directly as opposed to supporting the kind of rewriting you describe.

Hope that helps!

-Michael

Michael Bleigh

unread,
Feb 27, 2017, 6:26:47 PM2/27/17
to Firebase Google Group
We're still aware of the desire for prerendering and we are exploring how we think we can best address the need in a way that works well for our developers. I don't have anything more concrete for you at this time, though.

Cheers,
Michael

Doug Thompson

unread,
Mar 14, 2017, 12:37:27 PM3/14/17
to Firebase Google Group
Thanks and congrats again.

Alonso Holmes

unread,
May 29, 2017, 9:52:38 PM5/29/17
to Firebase Google Group
For me, this issue is less about prerendering and more about being able to serve a different version of a page to crawlers.

Prerendering is one possible way to accomplish this, but being able to redirect requests from crawlers to a simple webserver (or lambda/cloud function) that templates out some static HTML w/ <head> tags works just as well. I've already got one of these running, I just need a way to redirect to it.

So while a mature prerendering solution would be nice, a simple UserAgent-based redirect would really solve my problem in the interim.

Thanks for your work on Firebase!

- Alonso

Doug Thompson

unread,
May 30, 2017, 7:57:14 AM5/30/17
to Firebase Google Group
Alonso!

Looks like the latest launch with Firebase Cloud Functions should cover us off?


However, I admit to being a little lost. Is there an example in the sample list of functions that we can use as a starting point to understand the concepts?


There's an example for React but I wonder if there's any guidance on translating this to Angular. 


<< Slightly confused.

Michael Bleigh

unread,
Jun 1, 2017, 4:42:01 PM6/1/17
to Firebase Google Group
I'm hopeful that we'll fill out samples with Angular Universal in addition to React in the near-ish future. Stay tuned!

Reply all
Reply to author
Forward
0 new messages