Open doppiogancio opened 3 years ago
@doppiogancio yes, that's possible but that could be resource consuming. When writing to file, it's writing each piece separately so memory usage stays low.
@doppiogancio you can write to a temporary file location and then stream the contents into your desired location. Are you pushing sitemap to S3-like storage?
First of all thanks to both @samdark @terales for the answers.
@doppiogancio you can write to a temporary file location and then stream the contents into your desired location. Are you pushing sitemap to S3-like storage?
Yes, I am using FlySystem. I solved the problem creating the files in a temporary folder, and only after uploading them to S3.
@samdark I understand, you are right. Having the chance to provide a new writer from the outside do you think is doable? Any concern?
Current version is quite coupled in this matter. I've started big refactoring a few years ago in https://github.com/samdark/sitemap/pull/59 but then got occupied by other things. That new version should be better about replacing writers.
Hi, I found really helpful this package, but since I need to use a different writer I was wondering if its possible to add a method to export the XML as a string for both the classes Sitemap and Index.