RapidAPI Profile picture
Mar 23 โ€ข 14 tweets โ€ข 2 min read
What exactly is an HTTP cache.

Thread ๐Ÿงต๐Ÿ‘‡๐Ÿป
An HTTP cache is crucial for making your website fast.

Most websites you visit fetch data from the backend to display it on the web page.

Continuous calls to the server can make your website slow and hence worst User Experience.
This is where cache comes into the picture.

Cache is a technique using which the browser can store the resources in the local storage, reducing the number of round trips to the server.
Cache reduces the latency and number of calls, resulting in a fast and performance-optimized website.
There are two broadly divided categories of cache.

1. Shared cache
2. Private cache
Shared cache, as the term suggests, can be used by multiple users.

Whereas, private access is dedicated and accessible by the single user only.
Private cache exists in your browser. You can check by following the steps below.

Inspect > Select Application from the top navbar > Check Cache on the left tree. Browser cache memory.
The shared cache is accessible to multiple users. For example, Internet Service Provider serves resources to multiple users via shared cache.
You can handle the entire cache mechanism using the `Cache-Control` HTTP header.

It holds instructions for both request and response.
For example, if you want to revalidate the cached response each time with the origin server, use

`Cache-Control: no-cache`
You can also define the lifecycle of cache data using the `max-age` directive.

For example,

`Cache-Control: max-age=100`

The cached response will be considered fresh for 100 seconds.
When a client makes a GET request, the request first goes through a cache and then to the server.

The freshness of data is decided by `Cache-Control: max-age=X` and `age=Y` headers.

Data is fresh if `max-age` is greater than `age` else stale.
Refer to the attached infographic to understand what the cache workflow looks like. ๐Ÿ‘‡๐Ÿป Caching in API calls.
With that being said, this is pretty much it for this thread.

Follow @Rapid_API for more exclusive content. ๐Ÿ™๐Ÿ’™

โ€ข โ€ข โ€ข

Missing some Tweet in this thread? You can try to force a refresh
ใ€€

Keep Current with RapidAPI

RapidAPI Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @Rapid_API

Mar 25
What is a Web API and how do they differ from a REST API?

A Thread ๐Ÿงต๐Ÿ‘‡๐Ÿป
We can use Web APIs while developing a website.

It provides functionalities that we can use to add more features to our website.

Web APIs are primarily used with JavaScript though this is not always the case.
Web APIs can be accessed over the web using the HTTP protocol.

As server API is used to enhance the functionality of the server, similar Web APIs enable developers to build a web app that can reach a wide range of clients.
Read 10 tweets
Mar 24
Five free project-based courses for web developers.

Thread ๐Ÿงต๐Ÿ‘‡๐Ÿป
1๏ธโƒฃ Build and sell your own API

Make a profitable API from scratch and sell it on the RapidAPI Hub.

๐Ÿ”— RapidAPI.com/courses/build-โ€ฆ
2๏ธโƒฃ Build and Deploy a Google Maps Travel Companion Application

A great tutorial on building and deploying a Google Maps Travel Companion App using a free API available on RapidAPI.

๐Ÿ”— RapidAPI.com/courses/build-โ€ฆ
Read 7 tweets
Mar 24
Do you know the anatomy of an API request?

Thread ๐Ÿงต๐Ÿ‘‡๐Ÿผ
There are four main components:

Method
Endpoint
Header
body/data
๐Ÿ“Œ Method

The Method is the type of request sent to a server, such as GET, POST, PUT, PATCH, and DELETE.

These requests are used to create four types of actions for data in the server. These actions are Create, Read, Update, and Delete (CRUD).
Read 7 tweets
Mar 24
Let's discuss the correct flow of an HTTP session.

A Thread ๐Ÿงต๐Ÿ‘‡๐Ÿป
In HTTP protocol, a typical session has three phases:

โ€ข Establishes a TCP connection
โ€ข Client sends an HTTP request
โ€ข Server sends an HTTP response
๐Ÿ“Œ Establishing a connection

The client establishes the connection with the server using the TCP layer.

Default HTTP port with TCP layer is 80 but other ports might be used as well.
Read 13 tweets
Mar 23
API performance has never been more important!

Here are five ways to optimize your API calls for better speed and overall performance.

Thread ๐Ÿงต๐Ÿ‘‡๐Ÿผ
1๏ธโƒฃ Allow caching

Caching stores data from a request locally. This reduces page load time and latency because it allows easier access to data.
2๏ธโƒฃ Prevent over-fetching and under-fetching

Over-fetching means providing too much unnecessary information on a single endpoint.

Under-fetching means not providing enough data on a single endpoint, leading to the need to make another API call.
Read 9 tweets
Mar 22
What exactly is an API lifecycle.

Thread ๐Ÿงต๐Ÿ‘‡๐Ÿป
As APIs are essential in today's era, building and managing them becomes more crucial.

This is where API lifecycle management comes into play.
API lifecycle is the entire lifespan of any particular API from its planning phase to when it gets stale.

It covers several essential processes. Let's talk about it in a bit more detail.
Read 18 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(