সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
লেখক: লিন্ডসে সাইমন, ইউএক্স ডেভেলপার
প্রস্তাবিত জ্ঞান: বেসিক HTML, বেসিক জাভাস্ক্রিপ্ট, CSS এর কাজের জ্ঞান
রিফ্লো হল ওয়েব ব্রাউজার প্রক্রিয়ার নাম যা নথিতে উপাদানগুলির অবস্থান এবং জ্যামিতিগুলি পুনরায় গণনা করার জন্য, অংশ বা সমস্ত নথিকে পুনরায় রেন্ডার করার উদ্দেশ্যে। যেহেতু রিফ্লো ব্রাউজারে একটি ব্যবহারকারী-ব্লকিং ক্রিয়াকলাপ, এটি বিকাশকারীদের জন্য কীভাবে রিফ্লো সময় উন্নত করা যায় তা বোঝার জন্য এবং রিফ্লোতে বিভিন্ন নথির বৈশিষ্ট্যের (DOM গভীরতা, CSS নিয়মের দক্ষতা, বিভিন্ন ধরণের শৈলী পরিবর্তন) এর প্রভাবগুলি বোঝার জন্য এটি কার্যকর। সময় কখনও কখনও নথিতে একটি একক উপাদান রিফ্লো করার জন্য এটির মূল উপাদানগুলি এবং এটি অনুসরণ করে এমন কোনও উপাদানকে রিফ্লো করার প্রয়োজন হতে পারে।
ব্যবহারকারীর ক্রিয়াকলাপ এবং সম্ভাব্য DHTML পরিবর্তনগুলির একটি দুর্দান্ত বৈচিত্র্য রয়েছে যা একটি রিফ্লোকে ট্রিগার করতে পারে। ব্রাউজার উইন্ডোর আকার পরিবর্তন করা, গণনা করা শৈলী জড়িত জাভাস্ক্রিপ্ট পদ্ধতি ব্যবহার করে, DOM থেকে উপাদান যোগ করা বা অপসারণ করা এবং একটি উপাদানের ক্লাস পরিবর্তন করা কয়েকটি জিনিস যা রিফ্লোকে ট্রিগার করতে পারে। এটাও লক্ষণীয় যে কিছু ক্রিয়াকলাপ আপনার কল্পনার চেয়ে বেশি রিফ্লো টাইম হতে পারে - স্টিভ সউডারের টক " এমনকি দ্রুততর ওয়েব সাইট " থেকে নিম্নলিখিত চিত্রটি বিবেচনা করুন:
উপরের সারণী থেকে এটা স্পষ্ট যে জাভাস্ক্রিপ্টের শৈলীতে সমস্ত পরিবর্তন সমস্ত ব্রাউজারে একটি রিফ্লো সৃষ্টি করে না এবং রিফ্লো হতে যে সময় লাগে তা পরিবর্তিত হয়। এটি কিছুটা স্পষ্ট যে আধুনিক ব্রাউজারগুলি রিফ্লো সময়ে আরও ভাল হচ্ছে।
Google-এ, আমরা বিভিন্ন উপায়ে আমাদের ওয়েব পৃষ্ঠা এবং অ্যাপ্লিকেশনগুলির গতি পরীক্ষা করি - এবং আমাদের UI-তে বৈশিষ্ট্যগুলি যোগ করার সময় রিফ্লো একটি মূল বিষয় বিবেচনা করি। আমরা প্রাণবন্ত, ইন্টারেক্টিভ এবং আনন্দদায়ক ব্যবহারকারীর অভিজ্ঞতা প্রদান করার চেষ্টা করি।
নির্দেশিকা
আপনার ওয়েব পৃষ্ঠাগুলিতে রিফ্লো কমাতে সাহায্য করার জন্য এখানে কিছু সহজ নির্দেশিকা রয়েছে:
অপ্রয়োজনীয় DOM গভীরতা হ্রাস করুন। DOM গাছের একটি স্তরে পরিবর্তন গাছের প্রতিটি স্তরে পরিবর্তন ঘটাতে পারে - সমস্ত পথ রুট পর্যন্ত, এবং সমস্ত পথ পরিবর্তিত নোডের শিশুদের মধ্যে। এর ফলে রিফ্লো করতে আরও বেশি সময় ব্যয় হয়।
CSS নিয়মগুলি ছোট করুন এবং অব্যবহৃত CSS নিয়মগুলি সরিয়ে দিন।
আপনি যদি অ্যানিমেশনের মতো জটিল রেন্ডারিং পরিবর্তন করেন, তাহলে প্রবাহের বাইরে তা করুন৷ এটি সম্পন্ন করতে অবস্থান-পরম বা অবস্থান-স্থির ব্যবহার করুন।
অপ্রয়োজনীয় জটিল CSS নির্বাচকদের এড়িয়ে চলুন - বিশেষ করে বংশধর নির্বাচকরা - যাদের নির্বাচক ম্যাচিং করতে আরও CPU শক্তি প্রয়োজন।
এই ভিডিওতে, লিন্ডসে আপনার পৃষ্ঠাগুলিতে রিফ্লো কমানোর কিছু সহজ উপায় ব্যাখ্যা করেছেন:
[null,null,["2025-07-25 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eReflow, the web browser's process of recalculating element positions for re-rendering, can significantly impact web page performance as a user-blocking operation.\u003c/p\u003e\n"],["\u003cp\u003eVarious actions, like resizing the browser window or manipulating the DOM with JavaScript, can trigger reflow, with some operations being more time-consuming than others.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can minimize reflow by reducing DOM depth, optimizing CSS rules, using absolute or fixed positioning for complex rendering changes, and avoiding complex CSS selectors.\u003c/p\u003e\n"],["\u003cp\u003eModern browsers are continuously improving reflow times, but understanding and mitigating its impact remains crucial for creating performant web experiences.\u003c/p\u003e\n"]]],["Reflow, a browser process that recalculates element positions and geometries, can be triggered by actions like resizing the window, DOM manipulation, or style changes. To minimize reflow, developers should reduce DOM depth, minimize CSS rules and selectors, and perform complex rendering changes outside the normal flow using absolute or fixed positioning. Certain JavaScript style modifications cause varying degrees of reflow. Google prioritizes reflow considerations when designing web page features for enhanced user experience.\n"],null,["# Minimizing browser reflow\n\nAuthor: Lindsey Simon, UX Developer\n\nRecommended knowledge: Basic HTML, basic JavaScript, working knowledge of CSS\n\nReflow is the name of the web browser process for re-calculating the\npositions and geometries of elements in the document, for the purpose\nof re-rendering part or all of the document. Because reflow is a\nuser-blocking operation in the browser, it is useful for developers to\nunderstand how to improve reflow time and also to understand the\neffects of various document properties (DOM depth, CSS rule efficiency,\ndifferent types of style changes) on reflow time. Sometimes reflowing a\nsingle element in the document may require reflowing its parent\nelements and also any elements which follow it.\n\nThere are a great variety of user actions and possible DHTML changes\nthat can trigger a reflow. Resizing the browser window, using\nJavaScript methods involving [computed styles](http://www.w3.org/TR/1998/REC-CSS2-19980512/cascade.html#computed-value),\nadding or removing elements from the DOM, and changing an element's\nclasses are a few of the things that can trigger reflow. It's also\nworth noting that some operations may cause more reflow time than you\nmight have imagined - consider the following diagram from Steve\nSouders' talk \"[Even Faster Web Sites](/events/io/sessions/EvenFasterWebsites)\":\n\nFrom the table above it's clear that not all changes to the style in\nJavaScript cause a reflow in all browsers, and that the time it takes\nto reflow varies. It is also somewhat clear that modern browsers are\ngetting better at reflow times.\n\nAt Google, we test the speed of our web pages and applications in a\nvariety of ways - and reflow is a key factor we consider when adding\nfeatures to our UIs. We strive to deliver lively, interactive and\ndelightful user experiences.\n\n### Guidelines\n\nHere are some easy guidelines to help you minimize reflow in your web pages:\n\n1. Reduce unnecessary DOM depth. Changes at one level in the DOM tree can cause changes at every level of the tree - all the way up to the root, and all the way down into the children of the modified node. This leads to more time being spent performing reflow.\n2. Minimize CSS rules, and remove unused CSS rules.\n3. If you make complex rendering changes such as animations, do so out of the flow. Use position-absolute or position-fixed to accomplish this.\n4. Avoid unnecessary complex CSS selectors - descendant selectors in particular - which require more CPU power to do selector matching.\n\nIn this video, Lindsey explains some simple ways to minimize reflow on your pages: \n\n\u003cbr /\u003e\n\n### Additional resources\n\n- [Opera's Repaints and reflows](http://dev.opera.com/articles/view/efficient-javascript/?page=3)\n- Satoshi Ueyama's debug-Firefox reflow demos:\n - [google.co.jp reflow](http://www.youtube.com/watch?v=nJtBUHyNBxs)\n - [mozilla.org reflow](http://www.youtube.com/watch?v=ZTnIxIA5KGw)\n - [ja.wikipedia.org reflow](http://www.youtube.com/watch?v=dndeRnzkJDU)\n- [Nicole Sullivan on Reflows and Repaints](http://www.stubbornella.org/content/2009/03/27/reflows-repaints-css-performance-making-your-javascript-slow/)\n\nFeedback\n--------\n\nWas this page helpful? \nYes Great! Thank you for the feedback. If you have a specific, answerable question about using PageSpeed Insights, ask the question in English on [Stack\n| Overflow](https://stackoverflow.com/questions/tagged/pagespeed-insights). For general questions, feedback, and discussion, start a thread in the [mailing list](https://groups.google.com/forum/#!forum/pagespeed-insights-discuss).\nNo Sorry to hear that. If you have a specific, answerable question about using PageSpeed Insights, ask the question in English on [Stack\n| Overflow](https://stackoverflow.com/questions/tagged/pagespeed-insights). For general questions, feedback, and discussion, start a thread in the [mailing list](https://groups.google.com/forum/#!forum/pagespeed-insights-discuss)."]]