Site AI Auditمن Internet Solutions

Object Caching with Redis: When Your Website Needs It

27 سبتمبر 2026وقت القراءة: 7 دسرعة الموقع
Object Caching with Redis: When Your Website Needs It

Short answer: Object caching stores the results of database queries and other expensive computations in memory, so the application can reuse them instead of repeating the work on every request. A persistent object cache such as Redis or Memcached keeps those results between requests. It speeds up pages that cannot be served from a full-page cache: carts, checkouts, account areas, logged-in users, the admin dashboard and search. Brochure sites with good page caching gain little; online shops, membership sites and busy editorial sites often gain a lot. Setup needs the cache service on the server and an integration in your CMS, usually a plugin and drop-in file for WordPress.

Page caching is the first and biggest speed improvement for most websites. But it has a limit: it only helps when the same HTML can be served to many visitors. As soon as a page is personal, such as a cart, an account page or anything seen by a logged-in user, the application has to build it from scratch. That is where object caching comes in. It does not store whole pages; it stores the building blocks, so pages that must be built are built faster.

How object caching works

When a CMS like WordPress builds a page, it asks the database many questions: site settings, menu items, post data, user details, product prices, stock levels, plugin options. Many of those answers are the same from one request to the next. An object cache keeps them in fast memory under a key. The next time the same question comes up, the application checks the cache first and only goes to the database if the answer is missing or expired.

WordPress has a built-in object cache, but by default it is non-persistent: it only lasts for a single request and is thrown away afterwards. A persistent object cache connects WordPress to an external in-memory store such as Redis or Memcached, so cached data survives across requests and is shared by all of them.

Page cache vs object cache

Page cacheObject cache
What it storesComplete HTML pagesQuery results and computed data
Who benefitsAnonymous visitors on cacheable pagesEvery request that runs the application
Typical gainVery large for cacheable pagesModerate to large for dynamic pages
Helps carts, checkout, logged-in usersNoYes
Helps the admin areaNoYes
RequirementsPlugin, server or CDN cacheRedis or Memcached on the server, plus integration

The two are complementary. A well-configured site often uses both: page caching for the majority of anonymous traffic, object caching for everything else.

Which websites benefit

A small brochure site with page caching, few plugins and no logged-in users usually sees little difference, and the extra moving part may not be worth it.

Redis vs Memcached

Both are mature, fast, in-memory key-value stores. For typical CMS object caching, either works well. Redis is more common in current WordPress hosting and offers more features, such as persistence to disk and richer data types, and it is widely supported by object cache plugins. Memcached is simpler and very efficient for pure caching. In practice, use whichever your host supports and recommends.

How to set it up on WordPress

  1. Check your host. Many managed WordPress hosts include Redis or offer it as an add-on, sometimes with their own integration. Ask support before installing anything.
  2. Enable the service. On your own server, install Redis or Memcached and the matching PHP extension, and secure it so it is not reachable from the internet.
  3. Install an object cache plugin that supports your cache service. It adds an object-cache.php drop-in file to wp-content, which tells WordPress to use the persistent cache.
  4. Configure isolation. If several sites share one Redis instance, give each a unique key prefix or database so they do not read each other’s data.
  5. Verify it works. The plugin usually shows connection status and hit rate. Tools like Query Monitor show object cache hits and misses per request.
  6. Measure. Compare server response times for uncached pages, the cart and the admin before and after.

Things to watch

How to tell whether you need it

Look at where the time goes. If anonymous visitors get fast cached pages but carts, checkouts, logged-in pages or the admin are slow, and profiling shows many repeated database queries, object caching is a strong candidate. If the site is slow even for cached pages, the problem is elsewhere, likely images, scripts or hosting. And if uncached pages are slow because of one very slow query, fix that query first: an object cache hides it only when the result is cached, and the first request still pays.

An example: a growing online shop

A shop with a few thousand products runs on a VPS with page caching. Anonymous visitors browsing categories get fast responses, but customers complain that the cart and checkout feel slow, and the shop manager finds the order screens sluggish during busy periods. Query Monitor on the cart page shows well over a hundred database queries, many of them repeated lookups of settings, product data and shipping options that rarely change. After enabling Redis through the host’s control panel and installing an object cache plugin, the same cart request shows most of those lookups served from memory. Server response for the cart and checkout drops noticeably, the admin feels quicker, and database load during a promotional e-mail campaign stays well below its previous peaks. The page cache still handles the category pages as before; the object cache covers the parts it could never reach.

The same shop still had work to do on the front end: large product images and a heavy reviews widget. Object caching did not change those, which is exactly why it should be seen as one tool among several rather than a complete speed solution.

A realistic expectation

Object caching reduces database work, which often makes uncached pages noticeably faster and lets the server handle more simultaneous dynamic requests. It does not reduce page weight, images, JavaScript or layout shift, so it does not directly improve most front-end metrics. Think of it as a server-side tool for dynamic parts of the site, alongside a current PHP version, efficient plugins and adequate hosting resources.

How Site AI Audit helps

Site AI Audit measures how quickly your server responds as part of every check and runs Google PageSpeed for mobile for Core Web Vitals, compression and page weight. That shows whether your slowness is on the server side, where page and object caching help, or in the front end, where they do not. Findings are ranked by impact and explained in plain words. Run a free check before deciding.

Related reading

The bottom line

Object caching with Redis or Memcached speeds up the pages a page cache cannot serve: carts, checkouts, logged-in areas and the admin. Shops, membership sites and busy editorial sites benefit most; simple brochure sites rarely need it. Use your host’s offering if available, install one integration, secure and size the cache properly, and measure the effect on uncached requests.

الأسئلة الشائعة

What is object caching?

Object caching stores the results of database queries and other computations in memory so they can be reused. A persistent object cache like Redis keeps them across requests, which reduces database work for pages that must be built dynamically.

Do I need Redis if I already have page caching?

Not necessarily. If most of your traffic is anonymous and served from the page cache, the benefit is small. If you have many logged-in users, a shop or a busy admin area, object caching usually helps.

Is Redis better than Memcached for WordPress?

Both work well for object caching. Redis is more common in current WordPress hosting and supported by more plugins. Use whichever your host provides and recommends.

Can object caching cause problems?

Occasionally, for example stale data from plugins that do not clear their cache properly, conflicts between drop-in files, or too little memory. Flushing the cache and checking the configuration usually resolves these issues.

Does object caching improve Core Web Vitals?

Indirectly. It can reduce server response time for dynamic pages, which helps LCP on those pages. It does not affect layout shift or JavaScript-related responsiveness.

#Caching#Web hosting#WooCommerce#WordPress performance
افحص موقعك — مجانًا.ما الذي يجب إصلاحه في موقعك — ومن أين تبدأ.
ابدأ مجانًا

المزيد من المدونة

كل المقالات ←
Internet Solutions

المزيد من فريقنا

من تطوير Internet Solutions. جرّب بقية منتجاتنا — كل منها يوفّر وقتك بطريقة مختلفة.

internet-solutions.net ↗
01النشر التلقائي على وسائل التواصل
PostRSS

تنتقل المنشورات الجديدة من خلاصة RSS الخاصة بك تلقائيًا إلى Facebook وX وLinkedIn وTelegram وأكثر من 60 شبكة أخرى.

خطة مجانية · منذ 2014زيارة ←
02دردشة مباشرة بالذكاء الاصطناعي للمواقع
Talkmio

يجيب موقعك على الزوار على مدار الساعة من محتواك أنت وبلغتهم.

خطة مجانية · دون بطاقةزيارة ←
03مساعد بالذكاء الاصطناعي
Ask Mio

دردشة وبرمجة وتصميم وكتابة وبحث. يختار Mio أفضل نموذج لكل مهمة.

خطة مجانيةزيارة ←
04طيار آلي بالذكاء الاصطناعي للمدونة ووسائل التواصل
AI Blog Autopilot

يكتب الذكاء الاصطناعي مقالات SEO من 2000 إلى 3000 كلمة وينشر كل مقال على أكثر من 58 شبكة اجتماعية.

أول 3 مقالات مجانًازيارة ←
05زحف SEO متعمّق
Site SEO AI Audit

زحف SEO كامل عبر 7 مجالات، بما فيها الظهور في البحث بالذكاء الاصطناعي، مع إصلاحات مرتّبة حسب التأثير.

أول تدقيق مجانيزيارة ←
06خلاصات RSS والمنتجات
RSS Feed Creator

أنشئ RSS من أي صفحة ويب، بالإضافة إلى خلاصات منتجات لـ Google وMeta تتحدّث تلقائيًا.

خطة مجانيةزيارة ←
07تطوير المواقع وتحسين محركات البحث
Internet Solutions

مواقع ومتاجر إلكترونية وأنظمة مخصّصة، يصمّمها فريقنا ويبنيها ويديرها.

منذ 2011زيارة ←
Site AI Audit
نظرة عامة على الخصوصية

يستخدم هذا الموقع ملفات تعريف الارتباط حتى نتمكن من تقديم أفضل تجربة ممكنة لك. تُخزَّن معلومات ملفات تعريف الارتباط في متصفحك وتؤدي وظائف مثل التعرّف عليك عند عودتك إلى موقعنا ومساعدة فريقنا على فهم أقسام الموقع التي تجدها أكثر إثارة للاهتمام وفائدة.