Sitemap.xml - exclude pages more than 2 weeks old
Permalink
I have a news site with over 2,000 news stories (pages) under the news section. I don't need all of those in the sitemap file.
Is there a way I can exclude anything that is more than 2 weeks old from the sitemap file?
Is there a way I can exclude anything that is more than 2 weeks old from the sitemap file?
The problem I'm running into is that the cron job to generate the sitemap is timing out. I have it set to run each night at midnight, and when I come in the morning at 8am, it's still "running" though in reality has timed out.
What version of concrete5 are you using?
Latest version. 5.5.2.1
How are you running the cron job - presumably a shell script using wget or similar?
Perhaps your maximum execution time is too low - do you know what it is set to?
Perhaps your maximum execution time is too low - do you know what it is set to?
Running via the link provided in the Automated Jobs area - with a cron job to run that link at midnight each night.
My max execution time is 60 seconds - which I just increased from 30 seconds.
I feel like this is going to be a never ending cycle though...as my site gets bigger and bigger, the script is going to take longer and longer to complete.
My max execution time is 60 seconds - which I just increased from 30 seconds.
I feel like this is going to be a never ending cycle though...as my site gets bigger and bigger, the script is going to take longer and longer to complete.
If you look in concrete/jobs/generate_sitemap.php, in the run() method you'll see that the mod date of each pages is pulled out and pushed into the xml using $c->getCollectionDateLastModified()
You could skip those with an old date, but by the time you've got that far, there's little point.
I would be tempted to override the file, and bung in some logging info to try and identify where the performance bottlenecks are.
You could skip those with an old date, but by the time you've got that far, there's little point.
I would be tempted to override the file, and bung in some logging info to try and identify where the performance bottlenecks are.
Mike