TGViewer
Channel Public Channel
Diyorbek.dev | 👨🏻‍💻

Diyorbek.dev | 👨🏻‍💻

@diyorbekk_dev

Allohga taqvo qiling. Va Alloh sizga ilm beradi. [2:282]


Software engineer @ OctaneJS Core Team

Dasturchi, jiddiy, kamgap, oddiy inson


Òzim haqimda kòproq ma'lumot uchun: @Diyorbek_juraev_blog

Web sahifam: https://mrdiyorbek.uz/
Subscribers
381
Photos
299
Videos
35
Links
119

Showing posts older than #890 · Back to latest

Older Posts 20 shown
Post #889 81
30-Day Challenge: 2nd day.

1. Leetcode: ✅
Problem

2. Reading (25-30 pages): ✅

3. Writing & Reading Articles: ✅
Article

4. Typing & Vim Practice (25-30 minutes): ✅


@Diyorbekk_dev
  • 🔥 1
Post #887 91
30-Day Challenge: 1st day.

1. Leetcode: ✅ Problem

2. Reading (25-30 pages): ✅

3. Writing & Reading Articles: ✅ Article

4. Typing & Vim Practice (25-30 minutes): ✅

@Diyorbekk_dev
  • 🔥 3
  • 🆒 3
  • ❤‍🔥 1
  • ✍ 1
Post #886 91
30-Day Challenge

Hey everyone! 👋 I'm excited to announce that I've committed to a 30-day challenge focused on self-improvement and skill-building. Here's what I'll be working on every day for the next month:

1. Leetcode: Sharpening my problem-solving skills with daily coding challenges.

2. Reading (25-30 pages): Diving into a book each day to expand my knowledge and keep the brain engaged.

3. Writing & Reading Articles: I'll be writing and reading at least one article daily, focusing on topics that inspire and educate.

4. Typing & Vim Practice (25-30 minutes): Enhancing my typing speed and mastering Vim—because efficiency is key!

@Diyorbekk_dev
  • 👍 3
  • 🆒 3
Post #885 95

Forwarded from Diyorbek's blog (Diyorbek Juraev)

"Nobody's thinking about you and that's okay"

Ever felt like you're constantly trying to impress others? You're not alone.

As we navigate life societal pressures can make us feel like we need to be perfect.

But what if I told you that's a myth?

As we get older, we start to realize that people are mostly focused on themselves.

They're too caught up in their own lives to worry about yours.

So, why waste energy trying to be someone you're not?

Embrace your imperfections, pursue your passions, and live life on your own terms.

The sooner you realize that nobody is judging you as harshly as you judge yourself, the freer you'll become.

Remember, you're not here to please everyone.

You're here to live your best life.

So, let go of the fear of judgment and start shining bright.

@Diyorbek_Juraev_Blog
  • 🔥 2
  • 👍 1
Post #884 111
❌ Avoid Provider wrapping hell in React.

✅ Instead combine all your Providers using composition.


@Diyorbekk_dev
Post #883 122
⚛️ How to type generic components in React with TypeScript

@Diyorbekk_dev
  • 👍 1
  • 🔥 1
Post #881 119
Use TypeScript utility types like Omit to create more reusable and adaptable components

@Diyorbekk_dev
  • 👍 1
  • 🔥 1
Post #878 127
Server-Side Caching: An Overview

Server-side caching is a performance optimization technique used to speed up web applications by storing frequently accessed data in memory. Instead of repeatedly generating or fetching the same data from the source, the server retrieves it from the cache, which significantly improves response times.

Why Use Server-Side Caching?

Faster Response Times: By serving cached data, the server can quickly respond to user requests, reducing wait times and enhancing user experience.

Reduced Load on Backend Services: Caching minimizes the number of requests sent to your database or backend systems, which helps to reduce server load and improves scalability.

Cost Efficiency: With fewer backend queries, you can lower operational costs related to database usage and server resources.

How It Works

Cache Storage: When a request is made, the server first checks if the requested data is already in the cache. If it is, the cached data is returned immediately. If not, the server fetches the data from the original source, caches it, and then returns it to the user.

Cache Expiration: Cached data can become outdated over time. To ensure data remains current, cache expiration policies are used. Common strategies include:

Time-Based Expiration: Data is refreshed at regular intervals (e.g., every 5 minutes).

Event-Based Expiration: Data is updated or removed when specific events occur (e.g., data changes).

Cache Invalidation: Sometimes, cached data needs to be manually removed or updated, particularly when the underlying data changes. This process, known as cache invalidation, ensures that users receive the most up-to-date information.

Common Caching Strategies

In-Memory Caching: Stores data in the server’s RAM for rapid access. Examples include Redis and Memcached. This method is ideal for frequently accessed data that requires quick retrieval.

Disk-Based Caching: Stores data on disk storage, which is slower than in-memory caching but can handle larger volumes of data. Useful for less frequently accessed data or when in-memory storage is insufficient.

Best Practices

Identify Cacheable Data: Not all data is suitable for caching. Focus on data that is accessed frequently but does not change often.

Set Appropriate Expiration Times: Choose expiration settings that strike a balance between data freshness and system performance.

Monitor and Adjust: Regularly review cache performance metrics and adjust your caching strategy based on application needs and usage patterns.

Server-side caching is an essential tool for optimizing web application performance, helping to improve speed, reduce load, and lower costs. Implementing effective caching strategies can significantly enhance the efficiency and scalability of your systems.

#Cashing

@Diyorbekk_dev
Post #877 128
Assalomu alaykum salomatmisizlar.

Hozir personal website qilmoqchi bo‘lib turgandim. Shunga yordam beroladiganlar bo‘lsa alohida guruh ochib birga shug‘ullanardik.

NextJs ni yaxshi bilish kerek.

@Diyorbekk_dev
  • 👍 1
Post #875 117
Client-Side Caching

Client-side caching is when your web browser stores parts of a website—like images, CSS, and JavaScript—on your computer. This means that the next time you visit the site, your browser can load these elements from your local storage instead of downloading them again. It’s quicker and saves data.

How Does It Work?


First Visit: When you visit a website for the first time, your browser downloads all the necessary files from the server.

Caching: Your browser saves these files in a cache (a kind of local storage).

Next Visit: When you return to the site, your browser checks if the cached files are still valid. If they are, it loads them from the cache instead of downloading them again.

Why Use Client-Side Caching?

Faster Load Times: Since your browser doesn’t have to download everything again, pages load much faster.

Reduced Server Load: Fewer requests to the server mean it can handle more users at once.

Better User Experience: Fast-loading pages keep users happy and more likely to stay on your site.

How to Implement Client-Side Caching

You can control caching using HTTP headers like Cache-Control and Expires. These tell the browser how long to keep a file in the cache. Here’s a simple example for static files like CSS and images:

location ~* \.(css|js|jpg|png)$ {
expires 30d;
add_header Cache-Control "public, max-age=2592000";
}

This sets the cache duration to 30 days (2592000 seconds).

Best Practices

Set Expiry Dates: For files that don’t change often, set a long expiry date.

Versioning: Change file names when you update them to force the browser to load the new version.

Test Regularly: Use tools like Google’s Lighthouse to ensure your caching strategy works as expected.

#Cashing

@Diyorbekk_dev
  • ❤‍🔥 1
  • ⚡ 1
  • 👍 1
  • 🔥 1
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
Post #870 144

Forwarded from Diyorbek's blog (Diyorbek Juraev)

Mustaqil bo’lish kerakmi?

Oldimda ikkita muhim tanlov bo’ladi qay birini tanlash to‘g‘ri ekanligi haqida ko‘p o‘ylanib qolaman.

Katta risk olishdan qo‘rqaman to‘g‘risi. Katta ishlar qilinishi kerak bo‘lgan joyga katta risk ham bo‘larkan. Buni hozirgi millionerlar hayotidan ham bilsangiz bo‘ladi albatta.

Bir yaqin ukam Amerikadagi o‘zi yashab kelgan oila haqida aytib qolgandi. Ular farzandlari uchun (har biri uchun) yoshligidan alohida xona qilib berarkan va hammasini o‘zlariga topshirishar ekan.

Bu seni dunyoying sening olaming bu yerni qanday tutsang seni hayoting ham shunday bo‘ladi.

O‘zi tozalaydi ozi kiyimlarini yuvadi. O‘zi xohlagandek xonasini tartiblaydi. Mustaqil bajarilgan ishlarda ko‘p saboq olinadi. Mustaqil fikrlashga undaydi.

Biror bir katta tanlov ustidan riskga qaramay katta ishlar qilisha olishadi.

Biz uchun hozirda qoidalar tuzib bo‘lingan.

Maktab, - qo‘lingizni partaga qo‘yib jim o‘tirsangiz bo‘lgani, keyin litsey yoki universitetlar ular ham bir xil, hattoki hayotimizda ham mustaqil bo‘lish uchun imkoniyatlar juda kam.

Hamma ishni o‘zingiz qilishga urinib ko‘ring, zero o‘tinni o‘zingiz chopsangiz u sizni ikki marta isitadi.

@Diyorbek_Juraev_Blog
  • 🔥 3
Post #868 150
Object (uppercased): Represents properties common to all JavaScript objects, defined in the lib.es5.d.ts file of TypeScript. It includes properties like toString() and valueOf(). Boxable objects (string, boolean, number, bigint, symbol) can be assigned to it, but not vice versa.

{} (empty object): Represents an object with no members. It can access common properties through the prototype chain, similar to Object (uppercased), but they represent different concepts.

object (lowercased): Represents any non-primitive type. Primitive types (undefined, null, string, number, boolean, bigint, symbol) are not assignable to it, and vice versa.

#typescript

@Diyorbekk_dev
Post #867 119
Bugun "Notion" System designni o'rganib chiqdim.

Anchagina boshqacha ekan. Tushunarsiz bo'lgan narsalar ham bo'ldiku lekin yomon emas.

Diagram link

@Diyorbekk_dev
  • 🔥 2
  • ❤ 1
  • ⚡ 1
Older posts →
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 →