thumbnail

Support for CORS and Content-Encoding

Knowru now supports Cross-Origin Resource Sharing (CORS) and Content-Encoding headers.

Dear fans of Knowru,

We are very excited to share some of improvements we have made in our today's release.

1. Support for CORS (Cross-Origin Resource Sharing)

Before making HTTP requests, many frontend frameworks such as vue.js make OPTION requests (i.e. pre-flight requests) to API endpoints to gain permissions (or to see if they indeed have permissions) for their subsequent real requests. This entire mechanism is called Cross-Origin Resource Sharing, or in short CORS and it is a key component of Serverless Architecture where a frontend framework can make requests to resources on a different domain securely without having a backend server.

Knowru now supports CORS so that you can do "Serverless Machine Learning." By Serverless Machine Learning, we meant that once you host your machine learning models on Knowru, you do not have to maintain backend servers; rather you can have a static website consisting of HTML, CSS and JavaScript files that can be hosted on S3 or similar that talk to your machine learning models on Knowru directly.

Before

Serverless Architecture with Knowru

In such design, no cloud nor on-premise servers are necessary which reduces the ton of work you have to do when setting up web applications (e.g. configuring gateway, load balancing etc.) and also gets rid of the day-to-day maintenance work that you have to do to manage the infrastructure (i.e. you won't receive an email from AWS saying one of your EC2 instances will be retiring). Moreover, your machine learning model and web application are both hosted on a scalable infrasturcuture (ML models on Knowru and web applications in S3), which again removes tasks on deciding when and how to scale, and executing the decisions.

Of course Serverless Architecture won't be applicable to all situations but at least you can bear in mind that your frontend frameworks can talk to Knowru directly.

2. Support for Content-Encoding and Accept-Encoding

When communicating with your machine learning models in Knowru, the sizes of requests and responses (i.e. the sizes of JSON texts) can be humongous and the sizes alone can be a factor in slowing down your communication with our platform. As requested by a client of us to deal this kind of problem, we now support Content-Encoding and Accept-Encoding headers. When submitting requests, you can submit gzipped data body with setting the Content-Encoding header to gzip. Then Knowru will automatically unzip your data body and process your requests. Also all responses with appropriately large in size will be gzipped automatically with the appropriate header values. Most of modern web browsers and software packages will understand our gzipped responses without requiring any code from your end.

We hope that these changes would make your work and life better and easier. As always, if any question, please feel free to contact to support@knowru.com.

Regards,

Knowru Team

Tags

Comments