WordPress creating cache of search results in the browser
-
Wordpress creating cache of search results in the browser
When you search for a term in wordpress, it creates a url for that term.
For example, if you search for searchtest it will return a url:
example.com/?s=searchtestIf you make a new post and run the search again. the result will not include this last post.
In order to view, you will need to do one of the two things below:
01 Reload the Browser.
02 Wait for the cache expiration defined in htaccess.We have a problem there.
If we reduce the cache time in htaccess it will affect the entire site.The search results will be accurate, but the site will make many unnecessary requests in addition to slowing down all navigation.
That’s where the point comes.
How to disable the cache ONLY on links created by search results?So the results would always be up to date but without compromising performance.
I try this, but doesnt work:
<LocationMatch ".*/\?s=.*"> Header Set Pragma "no-cache" Header Set Expires "Thu, 1 Jan 1970 00:00:00 GMT" Header Set Cache-Control "max-age=0, no-store, no-cache, must-revalidate" Header Unset ETag FileETag None </LocationMatch>
- The topic ‘WordPress creating cache of search results in the browser’ is closed to new replies.