TGViewer
Diyorbek.dev | 👨🏻‍💻 Diyorbek.dev | 👨🏻‍💻 @diyorbekk_dev · 381 subscribers
Post #872 165
Techniques for High-Performance Web Apps - Caching.

Caching is the process of storing copies of files or data in a temporary storage location so that they can be accessed more quickly. When a request is made, the system first checks the cache; if the requested data is present, it can be served immediately without needing to retrieve it from the original source. This process reduces the time and resources required to deliver the data.

When to Cache?

▪️The data that doesn't change frequency can be cached.

Types of Caching

1 - Client-Side Caching: Browser Caching : Browsers store static assets like HTML, CSS, JavaScript, and images locally. Using cache control headers, you can define how long assets should be cached. The browser already uses multiple techniques to cache. Most of the GET responses are cached by default.


2 - Server-Side Caching:
HTTP Caching : Utilize HTTP headers such as ETag, Cache-Control, Expires, and Last-Modified to control caching behavior.

Content Delivery Network (CDN): CDNs cache your content at various geographically distributed servers, reducing latency and improving load times for users around the globe.

Reverse Proxy Cache : Tools like Nginx can act as intermediaries that cache responses from your server, reducing the load on your web server.

3 - Database Caching:
Query Caching: Store the results of expensive database queries to speed up subsequent requests. Most database systems, like MySQL and PostgreSQL, offer built-in query caching like using Indexing on the primary key, which makes a HashMap with the address of the location of the data.

Object Caching: Use in-memory data stores like Redis or Memcached to cache objects retrieved from a database, reducing the need to perform repetitive and expensive queries.

4 - Application-Level Caching

Page Caching: Store the entire rendered HTML of pages that don't change frequently.

Fragment/Component Caching: Cache parts of a page (like sidebar widgets) that change less frequently than the main content.

Data Caching: Cache expensive data computations or API calls.

#Cashing

@Diyorbekk_dev
  • 🆒 2
More from @diyorbekk_dev
  1. Sep 15, 2026ChatGPT and Codex now support TSRX syntax Highlighting! #tsrx #OctaneJS
  2. Sep 14, 2026Tanner Linsleydan yangilik. Hozirgacha Tanstack Team Octane uchun katta yordam berib kelmo…
  3. Sep 10, 2026Octane Js Hozirda Instagramda bitta content topoldim. Nasib tez kunda òzim yangiliklar qòy…
  4. Sep 9, 2026Ajoyib yangiliklardan biri. Tez orada Open AI butunlay òtadi nasib OctaneJs’ga. Tarqatmay…
  5. Sep 5, 2026Yangi joyni ham tizimlashtirdik. Bir qancha yangi imkoniyatlar qo‘shildi va yangi funksiya…
  6. Sep 5, 2026photo post
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →