How to create .xml.gz sitemap index ?

rizkiheryandi
0
rizkiheryandi
commented 2 years ago

I have web app with lots of URL of single product (let's say it's a e-commerce website).

Let's say i have 60.000 url to save in my sitemap, and i separate that with 2 sitemap.

And each sitemap i wanna compress it with .xml.gz format, to reduce its size.

I can easily do that with PHP (i used laravel), but how to do that with NuxtJs ? (even a pure javascript besides the NuxtJs)

Can someone help me ?

Thank you :)

0
delucis
8
delucis
commented 2 years ago

I don’t think this is currently possible with sitemap-module alone. It calls the .toXml() method from sitemap.js, which it is built on top of.

sitemap.js does implement a .toGzip() method although it seems to only use it for sitemap indexes not single sitemap files.

Your best options might be either be to fork sitemap-module replacing .toXml() calls with .toGzip(), or to write a separate Nuxt module, which processes sitemap-module’s output using Node’s built in Gzip tools. Haven’t tried either, so don’t know how well either of those would work.

0
Informations
QuestionUnresolved
#c14 - Created 2 years ago