از انجام کارهای طولانی که درخواست های شبکه مربوط به تبلیغات را مسدود می کند، اجتناب کنید
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
بررسی اجمالی
این ممیزی بررسی می کند که آیا اولین درخواست آگهی به دلیل کارهای طولانی به تعویق افتاده است یا خیر. یک کار طولانی به عنوان کد جاوا اسکریپت تعریف می شود که رشته اصلی را برای 50 میلی ثانیه یا بیشتر مسدود می کند. اگر کارهای طولانی قبل از درخواست آگهی اتفاق بیفتد، مرورگر نمی تواند درخواست را تا زمانی که تمام کارها تکمیل شود صادر کند.
توصیه ها
کارهایی را که اولین درخواست تبلیغ را مسدود میکنند بررسی کنید و راههای حذف آنها یا کاهش زمان اجرای آنها را زیر ۱۰۰ میلیثانیه بررسی کنید. برخی از رویکردها برای کاهش زمان اجرا عبارتند از:
بهینه سازی وظایف برای اجرای سریعتر
تقسیم وظایف به تکه های کوچکتر، که به صورت جداگانه در کمتر از 100 میلی ثانیه اجرا می شوند
به تعویق انداختن کارها تا پس از درخواست آگهی
جابجایی وظایف خارج از موضوع اصلی از طریق یک کارگر
اطلاعات بیشتر
این ممیزی 10 طولانی ترین کار برتر را بر اساس زمان اجرا، مرتب شده بر اساس زمان شروع (صعودی) نشان می دهد.
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThis audit identifies long-running JavaScript tasks (over 100ms) that delay the initial ad request, potentially impacting ad revenue.\u003c/p\u003e\n"],["\u003cp\u003eOptimizing, splitting, delaying, or offloading these tasks can improve ad loading times.\u003c/p\u003e\n"],["\u003cp\u003eThe audit highlights the top 10 longest tasks based on their execution time to help pinpoint problem areas.\u003c/p\u003e\n"],["\u003cp\u003eLong tasks block the main thread, preventing the browser from sending the ad request until they complete.\u003c/p\u003e\n"],["\u003cp\u003eAddressing these tasks is crucial for ensuring timely ad delivery and a smoother user experience.\u003c/p\u003e\n"]]],["This audit identifies long JavaScript tasks (100ms+) that delay the initial ad request. These tasks block the main thread, preventing the browser from issuing the request. The audit recommends reducing these tasks by optimizing, splitting them into smaller chunks, delaying their execution until after ad requests, or moving them off the main thread. The top ten longest tasks, sorted by start time, are displayed.\n"],null,["# Avoid long tasks that block ad-related network requests\n\nOverview\n--------\n\nThis audit checks whether or not the first ad request is being delayed by long\ntasks. A\n[long task](https://developer.mozilla.org/en-US/docs/Web/API/Long_Tasks_API) is\ndefined as JavaScript code that blocks the main thread for 50ms or more. If long\ntasks occur before an ad request, the browser will be unable to issue the\nrequest until all of the tasks complete.\n| **Note:** Although 50ms is the commonly accepted long task threshold, this audit will only flag tasks that block the main thread for 100ms or more. This is because shorter tasks generally have a smaller impact on ad loading.\n\nRecommendations\n---------------\n\nExamine the tasks that are blocking the first ad request and investigate ways to\nremove them or reduce their execution time below 100ms. Some approaches to\nreducing execution time include:\n\n- Optimizing tasks to execute faster\n- Splitting tasks into smaller chunks, which individually execute in \\\u003c 100ms\n- Delaying tasks until after ad requests are made\n- Moving tasks off of the main thread via a worker\n\nMore information\n----------------\n\nThis audit displays the top 10 longest tasks by execution time, sorted by start\ntime (ascending).\n\n[Are long JavaScript tasks delaying your Time to Interactive?](https://web.dev/long-tasks-devtools) \n\n[Inspect Network Activity In Chrome DevTools](https://developer.chrome.com/docs/devtools/network/) \n[View audit source](https://github.com/googleads/publisher-ads-lighthouse-plugin/tree/HEAD/lighthouse-plugin-publisher-ads/audits/ad-blocking-tasks.js) [Improve this article](https://github.com/googleads/publisher-ads-lighthouse-plugin/tree/HEAD/docs/audits/ad-blocking-tasks.md) [Report an issue](https://github.com/googleads/publisher-ads-lighthouse-plugin/issues/new?labels=documentation&template=documentation-feedback.md&title=Documentation+feedback%3A+ad-blocking-tasks.md)\n\n\u003cbr /\u003e"]]