Use Firebase as a CDN?

780 views
Skip to first unread message

Owen Densmore

unread,
May 5, 2016, 8:58:58 PM5/5/16
to Firebase Google Group
I'd like to store code on firebase. Would this work?

I realize code would just be a fb url to a string. But can I use that in a <script> tag?

If not, can I just download the string, wrap it in a Function Object's string, and execute that? Probably should work, right?

Michael Bleigh

unread,
May 5, 2016, 9:17:55 PM5/5/16
to Firebase Google Group
Hi Owen,

It really strongly depends on what you're trying to do. If this is infrequently changing code, I'd recommend Firebase Hosting. If it's user-supplied real-time code, then you won't be able to do it (and if you could it wouldn't be recommended). If you directly address a string leaf node from the realtime database, it will quote the response.

--
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/0dffe1b4-df28-4b4b-a41c-1bccb77d19da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Owen Densmore

unread,
May 5, 2016, 10:18:07 PM5/5/16
to fireba...@googlegroups.com
Thanks, saved a lot of time fussing around!

r...@rack.pub

unread,
May 7, 2016, 10:40:04 AM5/7/16
to Firebase Google Group
I would.  It's advertised as a Global CDN.  In terms of what type of code, I actually have some HTML stored/served in firebase nodes.  Just escape the double quotes with \.  The hosting itself will serve up static files - any flavor I would imagine.

The only thing is that there is no server side scripting supported (PHP,Python, etc).
Reply all
Reply to author
Forward
0 new messages