django-static-sitemaps
django-static-sitemaps copied to clipboard
Only generate xmls that changed from previous run (incremental updates)
If the sitemap's 'limit' and 'lastmod' do not change,can this app start write index from the last xml file?
@JasperYanky No, not at the moment. There is no 'memory' between individual runs (except for dirty checking to find out if we should ping google which is based on md5 hashes). Therefore, all the pages are generated from scratch in each run.
It sounds like a nice feature though, PR would be appreciated. Implementation should not be that difficult.
Interested to make the PR @xaralis but I'm wondering what should be the best implementation to save previously xmls generated ?
- first, last pks in filename ?
- Using DB ?
- Others ?
@ahivert I would recommend avoiding DB if possible. As I'm thinking, there is no simple way to tell if some record in the sitemap changed without processing it first. You definitely cannot tell based on the PK. You would need to process the records anyway. Maybe keep records in DB of fresh/dirty objects. But this involves DB again, which is not really nice.