LSCache Auto Preload
Automatically preloads purged URLs including homepage after LiteSpeed cache purge.
by hassan ali askari · github.com/hassan7303/lscacheautopreload
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/hassan7303/lscacheautopreload/archive/refs/heads/master.zipReadme
LSCache Auto Preload
Version: 1.0.0
Author: hassan ali askari
Overview
This plugin is designed to automatically preload pages after LiteSpeed cache purge.
Its main purpose is to ensure fast and ready cache for users immediately after the cache is cleared.
Features
- Automatically preloads the homepage after cache purge.
- Preloads important static pages:
- Shop (
/shop/) - About Us (
/about-us/) - Contact Us (
/contact-us/) - Blog (
/blog/)
- Shop (
- Preloads all published posts.
- If a post is a product (
productpost type), the shop page is also preloaded. - Requests are executed asynchronously (non-blocking) to avoid affecting site performance.
- Desktop requests are sent twice to ensure full cache build.
- Mobile devices including iPhone, Android, and generic phones are preloaded as well.
- Simple logging in WordPress
error_logfor preload status tracking.
Installation & Setup
- Place the plugin folder in
/wp-content/plugins/. - Activate the plugin from the WordPress admin panel.
- The plugin will automatically preload specified pages after cache purge.
How It Works
-
Single post or link cache purge:
The plugin preloads the specific link + the homepage.
If the post type is a product, the shop page is also preloaded. -
Full cache purge (
purge all):
The plugin preloads in order:- Homepage
- Important static pages
- All published posts
Notes
- The plugin uses a separate
run_preload.phpscript to execute async requests. - Non-existent pages (404) are logged in
error_log. - No cron jobs or server changes are required.
- The plugin preserves the existing async structure without affecting site functionality.
Developer
Developed by hassan ali askari.
LSCache Auto Preload
نسخه: 1.0.0
نویسنده: hassan ali askari
توضیح کلی
این افزونه برای پیشبارگذاری (preload) صفحات بعد از پاک شدن کش LiteSpeed طراحی شده است.
هدف اصلی این افزونه ساخت کش سریع و بدون تأخیر برای کاربران بعد از پاک شدن کش است.
ویژگیها
- پیشبارگذاری خودکار صفحه اصلی بعد از پاک شدن کش.
- پیشبارگذاری صفحات مهم ثابت:
- فروشگاه (
/shop/) - درباره ما (
/about-us/) - تماس با ما (
/contact-us/) - بلاگ (
/blog/)
- فروشگاه (
- پیشبارگذاری تمام پستها منتشر شده.
- اگر پست از نوع محصول باشد (
product)، صفحه فروشگاه نیز پیشبارگذاری میشود. - درخواستها به صورت غیرهمزمان (async) اجرا میشوند تا تأثیری روی عملکرد سایت نداشته باشند.
- دسکتاپ دو بار request زده میشود تا کش کامل ساخته شود.
- موبایلها شامل iPhone، Android و گوشیهای معمولی هم پیشبارگذاری میشوند.
- لاگ ساده در
error_logوردپرس برای بررسی وضعیت preload.
نصب و راهاندازی
- فایل پلاگین را داخل مسیر
/wp-content/plugins/قرار دهید. - از پیشخوان وردپرس، افزونه را فعال کنید.
- افزونه به صورت خودکار بعد از پاک شدن کش، صفحات مشخص شده را پیشبارگذاری میکند.
نحوه عملکرد
-
پاک شدن کش یک لینک یا پست:
افزونه لینک مربوطه + صفحه اصلی را پیشبارگذاری میکند.
اگر پست نوع محصول باشد، صفحه فروشگاه هم preload میشود. -
پاک شدن کل کش (
purge all):
افزونه به ترتیب:- صفحه اصلی
- صفحات مهم ثابت
- تمام پستها را پیشبارگذاری میکند.
نکات
- پلاگین از اسکریپت خارجی
run_preload.phpبرای اجرای درخواستهای غیرهمزمان استفاده میکند. - صفحات غیرموجود (404) نیز در
error_logثبت میشوند. - بدون نیاز به کرون یا تغییرات دیگر در سرور.
- افزونه با ساختار استاندارد async بدون تغییر در عملکرد سایت طراحی شده است.
توسعهدهنده
این افزونه توسط hassan ali askari توسعه داده شده است.