Skip to content

Commit

Permalink
Updating Varnish.md
Browse files Browse the repository at this point in the history
Updated contents of varnish as per comment.
  • Loading branch information
Yemaneberhan-Lemma authored Jun 21, 2023
1 parent 9daaf53 commit 9fbc2b0
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions content/docs/common-areas/reverse-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,18 @@ While reverse proxies are highly beneficial, they also present some challenges.

## Varnish

Varnish is a web application accelerator that acts as a reverse proxy. It sits between the client and the web server and speeds up the delivery of web content by caching frequently accessed content. Varnish stores a copy of the content received from the web server, and if another request for the same content comes in, it serves the content directly from its cache instead of getting the content from the web server again.
Varnish is a web application accelerator that acts as a reverse proxy. It sits between the client and the web server and speeds up the delivery of web content by caching frequently accessed content. Varnish stores a copy of the content received from the web server, and if another request for the same content comes in, it serves the content directly from its cache instead of getting the content from the web server again. Varnish can also be configured to purge the cache periodically or in real-time to ensure the content is always up-to-date.

Varnish acts as a middleman between the client and the web server, passing requests from the client to the server and then returning the server's response to the client. Varnish also caches the content received from the server, making it faster to serve content to subsequent requests. This caching feature is especially useful for websites that serve static content, as it can significantly reduce the load on the web server and improve website performance.

Varnish Reverse Proxy works by intercepting all incoming web requests and caching the content of the request on the server side. This means that subsequent requests for the same content will be served directly from the cache instead of having to be retrieved from the origin server. This speeds up the response time and reduces the server load.

When a user makes a request to a website, the request is sent to the Varnish server. The Varnish server then looks in its cache to see if it already has a copy of the content requested. If it does, the content is immediately served from the cache to the user. If it does not have a copy of the content, the request is forwarded to the origin server to retrieve the content.

Once the content is retrieved from the origin server, it is stored in the cache for future use. Varnish can also be configured to purge the cache periodically or in real-time to ensure the content is always up-to-date.
When a client makes a request to your website, Varnish first checks its cache to see if the requested content is already cached. If it is, Varnish serves the content from the cache, which is much faster than making a request to your web server. If the requested content is not cached, Varnish makes a request to your web server and caches the content for future requests.

Varnish Reverse Proxy can also be configured to perform other functions, such as load balancing and SSL termination. Load balancing distributes incoming requests across multiple servers to ensure that no single server becomes overwhelmed. SSL termination decrypts secure connections and encrypts outgoing connections, helping to protect user data.

Things to keep in mind:

- High learning curve: Varnish has a steep learning curve and requires extensive knowledge of HTTP, caching, and advanced configuration options. This can make it difficult for beginners to set up and manage.

- Limited support for dynamic content: Varnish is designed to handle static content and is less effective with highly dynamic content, such as user-generated content or real-time updates.
- Limitation on dynamic content: If the dynamic content of a web page is updated frequently, it can cause problems with Varnish reverse proxy. This is because Varnish caches the dynamic content, so if the content is updated, the cache will be stale. This can lead to inconsistencies between the cache and the origin server. This can result in user confusion and frustration. However, this can be mitigated by setting an appropriate cache expiration time or using features like cache invalidation or purging.

- Complex configuration: Varnish requires a lot of configuration to get the most out of it. Optimizing the caching configuration, for example, can be challenging and may require manual tuning to achieve the best performance.

- Limited SSL support: Varnish does not support SSL encryption out of the box, which means you need to set up a separate SSL termination proxy to handle secure connections, which can add complexity to your infrastructure.

- Potential for caching issues: In some cases, Varnish can serve outdated content from its cache, leading to inconsistencies between the cache and the origin server. This can result in user confusion and frustration. However, this can be mitigated by setting an appropriate cache expiration time or using features like cache invalidation or purging.

0 comments on commit 9fbc2b0

Please sign in to comment.