django-static-sitemaps icon indicating copy to clipboard operation
django-static-sitemaps copied to clipboard

Only generate xmls that changed from previous run (incremental updates)

Open JasperYanky opened this issue 8 years ago • 3 comments

If the sitemap's 'limit' and 'lastmod' do not change,can this app start write index from the last xml file?

JasperYanky avatar Jul 25 '16 09:07 JasperYanky

@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.

xaralis avatar Jul 25 '16 09:07 xaralis

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 avatar Aug 23 '18 11:08 ahivert

@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.

xaralis avatar Aug 23 '18 11:08 xaralis