How Can I Make My Google Firebase-Hosted Static Site Faster? - firebase

I'm hosting a static website generated by Hugo on Google Firebase. I know Firebase simplifies a lot of things from Google Cloud via its console and default settings. However, I'm hoping to make my site faster, and I was wondering if there was any settings I could change on the larger Google Cloud platform such as increasing the number of places the site deploys from, or using an SSD, or a faster virtual machine etc.
This is for a static website generated by Hugo being hosted on Google Firebase and with a CDN via CloudFlare. I've done plenty of optimization via the typical website optimization stuff, but I was wondering if there was anything I could do on Google Cloud Platform to increase the reach of my site and its speed etc.

Firebase Hosting doesn't have any configurations that tune its runtime behavior, in terms of performance. The only configurations it has are documented here.

Related

Firebase as a CDN?

I just setup a Firebase Hosting and deployed it.
My question is, can I use this hosting as a cdn to load content on my other already published site?
Is this a good practice?
Also, is there a limit on firebase hosting requests?
If for e.g. there are too many requests to a particular file type, does it still work or will it throw any error?
Firebase hosting is advertised by Google as edge optimized SSD storage in their CDN infrastructure. Google's documentation suggests that this is a supported use case.
If you are already using firebase, that should work for you. Implement, measure. Keep measuring as traffic volume and patterns change.
If it isn't meeting your needs, move to a different CDN solution.

Downsides of firebase functions vs firebase hosting

I want to host my static webapp created with Next.js' export function on firebase. The app rebuilds itself to static html when changes in the underlying database are made. Since I can't directly deploy this static pages automatically to firebase hosting, I tend to serve the static files from with.
So, are there any downsides of serving static html content with Express.js inside firebase function compared to using firebase hosting?
Especially with regard to: Pricing, Security and Performance/Speed.
We hosted our site (https://mfy.im) under Firebase hosting, it's generated using nuxt, similar to your next.js. We've compared many other static hosting sites including Netlify, S3, etc. Firebase hosting was the best in performance
Even though Express can serve your static files, it's not recommended. Firebase internally uses Nginx. Nginx is super fast in serving static files and it's multithreaded. In Nginx, its easy to confiture http2, gzip etc. (full http2 support is recently released in Node 10, gzipping files in node js is also not that performant since the node is single threaded)
Other advantages of Firebase hosting is its edge servers, built-in CDN, SSL etc. A copy of your site is deployed on multiple servers all around the world which results in low latency. I've tested Firebase CDN vs CloudFlare, again Firebase was the best
Regarding Pricing, Firebase hosting comes with a free plan of 10GB bandwidth. It should be efficient for small-medium websites. If your bandwidth usage is higher than that you can go for 'Pay as you go'. However, if you're worried about pricing you can combine Firebase hosting with CloudFlare CDN so that CloudFlare will cover most of the bandwidth

How to optimize Firebase hosting for http/1.x

I use Firebase hosting to host my Single Page App.
I have two versions of my websites :
one optimized for https/1.x
one optimized for https/2
Firebase hosting is now using https/2. But how to optimize the website for the people still using a browser who only support https/1.x? Knowing that, as of today, there is still 20% of the browser who don't support https/2.

google cloud and wordpress

I have just started playing with Google cloud. I used to work on normal servers so I need advice.
I created my first instance and deployed Wordpress. I installed woocommerce plugin. The shop is quite fast and I am happy (with the lowest settings) but now:
I wanted edit function.php but I can't. The attributes are read only so How can I change it?
How to get access to my all files I can't see them in storage cloud. How to set up ftp?
What about database for my shop? I understand I can create new data base but where to access to current data base of my wordpress.
What should I deploy more to work comfortable with my wordpress?
About ssl
SNI SSL certificate slots are offered for no additional charge for
accounts that have billing activated. Free accounts are limited to 5
certificates.
I have no experience with ssl but I plan run shop so what it means. Free certificates for 5 instances or 5 deployement ? How many certificates do I need to run one shop?
I know there are many questions but I wanted to go further and all advise on internet is outdated because are for older versions of google cloud. Please help me to understand this all.
I assume you're attempting to use WordPress on Google App Engine.
GAE has no real filesystem, so you cannot write to it (unless you juggle with the API GAE offers). Editing happens locally using the GAE SDK development server and you deploy your changes to the App Engine ecosystem using the SDK interface (GUI or CLI). All application writes should go to Google Cloud Storage (which is similar to Amazon S3 and the like).
I'm not certain whether the Google Cloud Storage can be accessed via traditional FTP. There might be some middleware required. You can see and browse the contents of your buckets in the developer project console (https://console.developers.google.com/).
The databases are on a separate "server" when using GAE. MySQL instances are spawned into the Google Cloud SQL ecosystem, which are available for App Engine and Compute Engine instances (and why not other places too). You can define the GCSQL address and port to wp-config.php like normally. You need to create a local MySQL database for your local installation. More: https://cloud.google.com/appengine/docs/php/cloud-sql/
When working with Google App Engine you should deploy the whole WordPress installation (wp-config.php, wp-includes/, wp-admin/, wp-content/, etc.) in order for it to work in the GAE system. For a "better" deployment system you should do some searching or ask a new question dedicated for that issue.
The certificates themselves on GAE are not free, but the "slots" you put the certificates into are. Free projects (no billing enabled) offer 5 free slots where you can put your purchased certificates. SSL SNI means that you can use multiple different domain/host certificates under a single listening IP address (which some years back was not that simple to do). What this all means that GCP offers a way to use certificates with their services, but you still need to get the certificates themselves elsewhere.
Have you seen the GAE starter project offered by Google: https://googlecloudplatform.github.io/appengine-php-wordpress-starter-project/ ? It makes your live a bit easier when developing WP sites for Google App Engine.
If you're working with Google Compute Engine instances, then they should operate just like regular VPS machines, with some Google restrictions applied. I have not used them so I do not know the specifics.

Scaling WordPress using Google App Engine and Google Cloud SQL

We need to use WordPress for a site that is going to have high traffic. We expect an initial load of 500K page views a month and will increase to about 8M page views a month. Usage will be mainly during working time, which is around 20 days a month during 8 hours.
We are thinking on using Google App Engine with Google Cloud SQL. We were wondering how well it scales for that kind of load. Theory says Google App Engine should scale automatically, but not sure how good is Google Cloud SQL when scaling. This will be a mostly read database, which a few writes.
So the questions are:
Does anyone has experience deploying WordPress on Google App Engine + Google Cloud SQL with a high load?
Do you know if there are problem installing plugins for WordPress on Google App Engine? Do they need any especial modification?
To save you some time, look to other solutions.
I'm working on this exact task now, but I'm about to give up due to Cloud SQL's very poor performance. It might work fine for websites like Orane's, but for larger more complex websites the high latency and slow response time from Cloud SQL means for us 3 second load times instead of 0.7s that we have on our VPS. I have tested by connecting to both IP and Socket, SSL and without, and it's just not usable as-is. If you test with Amazon RDS, the difference in speed is shocking.
The only other solution we've been able to come up with is to set up an API server that continously caches data to memcache and only serve static pages on App Engine with most dynamic content loading through AJAX. Scary!
Keep trying, but you'd be better off looking into RackSpace Cloud DB or Amazon RDS.
There are no problems at all and it doesn't need any modifications. Everything works perfectly and from previous projects I've done on appengine, I know it scales extremely well. I've just set up my new wordpress blog on appengine here and everything works the same but loads a lot faster. Its a little tricky to get setup however..I'm working on a tutorial for that.

Resources