Skip to main content

How to Compress and Resize/Scale Images in ASP.NET Core

Large size images are slow to load and optimizing them can reduce bandwidth and help your website load faster. TinyPNG is a great place to compress JPEG or PNG images. In fact, we always use TinyPNG to compress images, created for this blog. Along with web interface, they also expose REST API (Free/Paid) to compress images on the fly. In this post, let’s find out how to compress and resize/scale images in ASP.NET Core using TinyPNG API.
Read More

Support multiple versions of ASP.NET Core Web API

Versioning helps in rolling out features on a timely basis, without breaking the existing system. It can also help to provide additional functionalities to selected customers. API versioning can be done in different ways like appending the version in the URL or as a query string parameter, via custom header and via Accept-Header. In this post, let’s find how to support multiple version ASP.NET Core Web API. Read More

upload file via Swagger in ASP.NET Core Web API

How to upload file via Swagger in ASP.NET Core Web API

Swagger is a simple, clean and powerful representation of your RESTful API. Once integrated with WEB API, it provides a UI which helps in testing the API with ease. In my earlier post, I explained about how to integrate swagger with the ASP.NET Core Web API. And it works great with all HTTP verbs and input parameters. But uploading a file via Swagger is not straightforward. In this post, let’s find out how to upload file via Swagger in ASP.NET Core Web API. Read More

Response Caching in ASP.Net Core 1.1

With the ASP.NET Core 1.1 release, many new features were introduced. One of them was enabling gZip compression and today we will take a look at another new feature which is Response Caching Middleware. This middleware allows to implement response caching. Response caching adds cache-related headers to responses. These headers specify how you want client, proxy and middleware to cache responses. It can drastically improve performance of your web application. In this post, let’s see how to implement response caching in ASP.Net Core application. Read More

How to enable gzip compression in ASP.NET Core

ASP.NET Core 1.1 has an inbuilt middleware for Response compression, which by default uses gzip compression. All modern browsers support response compression, and you should take advantage of it. Instead of sending response from the server as it is, it’s better to compress it and then send it, as this will reduce the response size and provides better speed. So in this post, let’s see how to enable gzip compression in ASP.NET Core. Read More

Import and Export xlsx in ASP.NET Core

This post shows how to import and export .xls or .xlsx (Excel files) in ASP.NET Core. And when thinking about dealing with excel with .NET, we always look for third-party libraries or component. And one of the most popular .net library that reads and writes Excel 2007/2010 files using the Open Office Xml format (xlsx) is EPPlus. However, at the time of writing this post, this library is not updated to support .NET Core. But there exists an unofficial version of this library EPPlus.Core which can do the job of import and export xlsx in ASP.NET Core. This works on Windows, Linux and Mac. Read More