You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#17: Added ability to set file size limit
* Refactor the file writing variations into classes
Among other things this gives us exactly one point in the code—inside
Sitemap::flush—where the data from the XMLWriter is read and forwarded
for saving into the site map file. At that point we are then able to do
accounti
783E
ng regarding the amount of data written.
Furthermore the writer back end keeps the file open, instead of
repeatedly calling file_put_contents. Thus we will not have to buffer
the URLs anymore.
* Add possibility to limit site map file size
By default set limit to 10 MiB to guarantee compatibility with most
current search engines.
* Reduce default buffer size
The OS is already doing file page buffering and bigger values provide
only marginal benefits. This is supported by the fact the tests show no
noticeable difference in execution time.
As noted in the readme, small numbers for the buffer size are good for
utilizing the available file size limit. Especially if there are a lot
of language variants. E.g. for 10 languages each buffer entry consists
of 130 = 10⋅(10+3) lines. So the previous buffer size of 1000 entries
might lead to a buffer which is already over 10 MiB big. In that case
the size limit is broken.
* Add setMaxBytes method to README file
Support of multi-language sitemaps with alternative links for each lo…
…cation (#50)
* Added support of multi-language sitemaps with alternative links for each location
* Fixed letter case in phpdoc and README.md