Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7856063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:34:40+00:00 2026-06-02T20:34:40+00:00

I wish to include Smart PHP Cache layer on top of main script on

  • 0

I wish to include Smart PHP Cache layer on top of main script on site. It works great, but Smart Cache also caches some pages which should not be cached (search results, admin area…).

I looked into Smart PHP Cache source code, and I am not sure if there is some way to configure which pages should be excluded from cache, or how to configure it.

So, what I need is some php code which will be inserted at top of main script of site, before Smart PHP Cache code which will first check if page contains for example:

“/search/”

“/admin/”

“/latest/”

“/other-live-pages/live-page.php”

and then, if something from above example is in URL to do nothing, (not to include smart_cache.php and to continue with other normal code, so user could see live results) and otherwise if there is nothing from above to include smart_cache.php.

Or.

If you have better knowledge to make modification inside Smart PHP Cache to be able to exclude some URLs from caching mechanism (or to tell me how to do that, because it looks like there is something in configuration of Smart PHP Cache that can bypass the cache layer but I am not sure how to use it.

Best regards.


Question update:

Thanks for answer. It works nice, I just wish to ask can you please little change code to make this:

If “pos1” (if URL contains “/search”), than nothing, false, like it is now

if “pos2” (if URL contains “/admin”), than nothing, false, like it is now

if “pos3” (if URL contains “/latest”) include file “smart_cache_latest.php”

and after that like it is now, include “smart_cache.php” for any other URLs.

So practically only change is for URLs with “/latest”, which should be cached too by including “smart_cache_latest.php”.

Best regards.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T20:34:43+00:00Added an answer on June 2, 2026 at 8:34 pm
    $currenturl = $_SERVER['REQUEST_URI'];
    $pos1 = strpos($currenturl, "/search");
    $pos2 = strpos($currenturl, "/admin");
    $pos3 = strpos($currenturl, "/latest");
    
    if ($pos1 === false && $pos2 === false){
        require '/path/to/smart_cache.php';
    } elseif($pos3 == true) {
        require '/path/to/smart_cache_latest.php';        
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wish to include JSPs include files which contain java code in a PHP
I have a dotnet web solution. I wish to include the silverlight technologies into
I wish the UIPIckerView would allow you to scroll then select but since it
I have a localized iOS application in which I wish to include some localized
Once again, I wish C++ had stronger typedef s: #include <vector> template<typename T> struct
I wish to include the call stack (e.g. the methods that called me) in
I wish to include the dll output by a project built from an external
I wish to include a file path in an SQL Server query which is
I wish to include this in my cpp file: #include <boost/lambda/lambda.hpp> For my Makefile
I wish to include display a jsp page as an aui dialog in liferay,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.