1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Site Search Cache

Discussion in 'General Scripting Chat' started by youtalk, Dec 11, 2012.

Tags:
  1. youtalk

    youtalk Regular Member

    Joined:
    Jul 5, 2012
    Messages:
    337
    Likes Received:
    6
    Occupation:
    Owner
    Location:
    I don't even know anymore
    I had an idea, and I'm not sure how it would work.

    I was thinking of having a site search cache created for my site. So whenever someone did a search on my site, that information would be stored in a cache.
    Then what I was thinking, was to have this cached for G to see it. In the hopes this would drive G to go look at those pages, and in return increasing indexing.

    Will it work?
    How would it need to be done?
    Etc..?

    My site is ran off of PHP.
     
  2. Grizzy

    Grizzy Senior Member

    Joined:
    Nov 11, 2008
    Messages:
    919
    Likes Received:
    999
    You could use memcache to do this, but I'm not sure why you think this will have an effect indexing. Google will see your server-side generated search results as long as it can find and crawl them (whether they are cached or not). In-memory caching is generally performed in order to reduce load on a database.

    Basically:
    1) User performs a search for "pizza".
    2) PHP checks memcache to see if a key for "pizza" exists.
    3) If key exists it's value is returned and outputted for the user. If key doesn't exist, database is queried, results are returned for user, and results are set in the cache for future searches.

    Something to keep in mind when dealing with memcache in this sort of situation is that MySQL resource variables can't be cached, the data needs to be serialized. If your query returns more then one row, you'll probably need create a multi-demensional array from the data before it is set in memcache.
     
    Last edited: Dec 12, 2012
  3. olystyle

    olystyle Regular Member

    Joined:
    Jan 6, 2012
    Messages:
    238
    Likes Received:
    103
    Hi youtalk

    I am not sure if G is interested in the searches of your visitors - but what you want can easily be made - post your search.php - and I will help you...

    cheers olystyle
     
  4. youtalk

    youtalk Regular Member

    Joined:
    Jul 5, 2012
    Messages:
    337
    Likes Received:
    6
    Occupation:
    Owner
    Location:
    I don't even know anymore
    You don't think G would look at the search cache as a good thing and want to know about the pages the users are searching for?