How to optimize Google Maps API integration - optimization

I've tried to evaluate my website with PageSpeed and I saw most warnings (Leverage browser caching, combine external javascript...) come from Google Maps API integration.
So my question is, is there a way to use it as PageSpeed would like?
Thanks.

Probably not, the external js files can change. If you combine them or host them locally with expires headers you may encounter bugs when they change.

I suggest to read this article in Google Blog: https://maps-apis.googleblog.com/2015/09/map-tips-speeding-up-page-load-times.html
Asynchronously loading JavaScript on your pages can give you huge performance wins. We have just updated all of our JavaScript Maps API samples and you can make these changes to your site, too. Read on to find out what we did and how it works, or skip straight to Unblocking scripts to see what you can start to update on your site today.

Related

How to make reactjs serve static pages for SEO

I have this reactjs webapp - http://52.26.51.120/
It loads a single page and then you can click links to dynamically load other boards on the same page... such as 52.26.51.120/#/b, 52.26.51.120/#/g
Now the thing is, I want each of these to be an individual page, for the purpose of seo. I want you to be able to google "my-site.com g", and you will see the result 52.26.51.120/#/g. This obviously cant work if you are using reactjs and it is all on one page. Google will only render and cache that main page (can it even render that page? does google execute javascript?)
Even more specifically, id want something like my-site.com/g/1234 to load a thread. There could be a thousand threads every day, so im not sure how to handle that.
Are there any solutions to this? to allow react to possibly serve up static pages as html so that they can be cached on google? I am using expressjs and webpack as my server right now, and all the code is executed in jsx files.
Thanks
You can use Prerender.io service. In a nutshell you will need to connect your server app or web server with prerender service and do little setup (see documentation). After that search engines and crawlers will be served with a static (prerendered) content while users will get classic React.js (or any other single page) app.
There is a hosted service with free tier or open source version
I suspect you could do some smart configuration with nginx and it could convert a url of domain/board to a redirection of domain/#/board when detecting the user-agent as a bot instead of a typical user.

Soundcloud API Download

I am asking this here because Soundcloud does not have support. I going to build a website that people can purchase audio files from using Soundcloud to download the files (and stream before buy). I want to be able to access the download file link in the Soundcloud API without the download link being enabled and showing on the Soundcloud UI. I can't seem to find this info in the Soundcloud API docs. I am going to have a Paypal redirect after the payment to the download link. I know this is a weird way of doing this but I have certain criteria I have to meet. I would host the audio files on my server but they are huge. Anyone have experience with this or can help?
im not sure its possible to do what you want. (very easily at least)
there would be no way for the purchaser to access the 'download' track on soundcloud directly unless downloads are specifically enabled for that track.
really the only way to not host the files and still be able to provide the download would be to use the api to download or proxy the track from soundcloud to your server, using your credentials (because you always have access to your own tracks, download or stream). mind you this would use 2x the bandwidth usage (the server getting the track from soundcloud, and the client downloading the track), and storage space would only be impacked on a temporary bases. but. this is a pretty hacky way and not really a good/proper solution.
you can:
-compress/re-encode the audio as to not use as much disk space
-pay for more storage space at your web host, its usually pretty cheap thse days.
So you want to charge on something free? Well, I think all the downloader out there are middleware where they stream the track from soundcloud and response to client as attachment upon request, one of many examples is http://wittysound.com. Cheapest way to get thing done is providing direct link to soundcloud server like what http://soundflush.com does

google now integration on website for Websiteupdates in Google Now

I am working on some integrations for Google Now.
The Schemas for Email-Notifications are clear,...
But bow I am searching for integrating our Website-News as well.
(I always get "website update-cards from Ryanair on my GNow)
But I cant seem to find the right schemas for it,... I dont even know if it is done by schema-markup-micromarkup-whatever lol
Any help or idea?
Thank you lots
Greets
Ray
Okay I have been wondering this same question for a while and these are what I have found.
Google Now doesn't support my PHP site but it does support another Drupal site of mine.
The only page that Google Now provides integration is here: https://www.google.com/landing/now/integrations.html
I found that quite some of the supported websites have rss.xml on its root.
So here's what I recommend to do: (I'm still trying so I'm not certain if the following methods are worth trying)
Use Drupal or other well-known CMS in case Google Now only supports a few kinds of websites.
Go to that page and try to get in contact with Google. (I haven't got replies yet though)
Try to add an rss.xml on your site's root and add a link to it at your default page. (I haven't got time to try it yet)

Integrating Gumroad API into Github Pages

So Gumroad has a really cool API and Github has some cool Pages functionality. Has anyone tried to integrate Gumroad's API with Github Pages as a store front to sell software?
Would it be worth attempting? From my quick reading on the Github Pages it looks like the page source is published in your repo. So maybe it wouldn't work too well if you had your Gumroad API key tied into it?
Just a thought that hit me while working on something today and wanted to see if anyone has successfully accomplished this with Gumroad + Github.
It would be completely reasonable to combine Gumroad and Github Pages to create a website where you can sell software.
The easiest way, however, would probably be to just add in the embed code for your products into the Github Pages website, which would work perfectly. I'm not sure if you can use Node.js in Github Pages, but if possible, you can use the higher level API's as well.
P.S. You should try to create this. I'm planning to do something similar with artwork!

To build an App for an Internet site without its API and Schema

I was asked to build a control-system for a Ebay-like Finnish auction-site huuto.net.
The system would reopen closed auctions by a specific rules. It would be completely external from the main site, running at an external website.
The site is however unwilling to release its API and Schema. I know no way to build such a system without knowing its API.
How do you build an internet site without its API and Schema?
You could try some form of automatic browsing: mechanize
Edit:
Examples here.
I think you're asking about building a site that interacts with another site without using a well-defined API. Is that right?
You can interact with an external site without using an official API - in order to do so, you need to imitate a normal site visitor and send your requests to the site frontend (in much the same way as a web crawler does). Tools like hpricot, mechanize and curl can help you parse the content of pages and send requests, but in doing so your system may be quite brittle. Any change to the target site might mean you have to rewrite portions of your system.
It might be possible to get the data you need by screen scraping the site. You could perform the operations you want to do by POSTing data into their forms or using a WebClient type API to make your program act like a web browser but that's likely to be an extremely brittle solution.
Honestly though, without an API, there really is no good solution.
you either need access to the database or an API, otherwise no point in even trying.