Page 1 of 1

Want To Cache Urls In Sitemap only

PostPosted: May 17th, 2010, 4:35 pm
by bilalbhatti
Hi, i want to cache all of my blog posts in SItemap. I don't want to cache any other URL. Just Sitemap URLs. How to configure Quick-Cache plugin to only cache sitemap URLs? :?:

Re: Want To Cache Urls In Sitemap only

PostPosted: May 19th, 2010, 1:44 am
by Jason Caldwell
Thanks for your question.
Quick Cache uses your Sitemap, only in conjunction with it's Auto-Cache Engine. So you can use a Sitemap to tell Quick Cache which URLs you want cached automatically, but this does NOT determine "overall", which URLs are allowed to be cached. That capability is not provided by the Quick Cache plugin.

However, there are several filters you can apply, see: Quick Cache -> General Options. You might give those a try. See if you can come up with a creative way to exclude anything buts Posts. You could also use a special PHP Constant inside your WordPress® theme. This will disable Quick Cache on everything, except Posts. You can put this inside the functions.php file for your WordPress® theme.

Code: Select all
<?php if(!is_single() || is_page())
   define("QUICK_CACHE_ALLOWED", false);
?>

Re: Want To Cache Urls In Sitemap only

PostPosted: May 19th, 2010, 1:26 pm
by bilalbhatti
Its cache 404 pages too,

<?php if(is_404())
define("QUICK_CACHE_ALLOWED", false);
?>

Will it solve the problem?

Re: Want To Cache Urls In Sitemap only

PostPosted: June 21st, 2010, 11:26 pm
by Jason Caldwell
Yep, that should do it. Sorry for my delayed response.