An open API service indexing awesome lists of open source software.

https://github.com/terales/multi-writes-to-gzipped-file

[RESEARCH] Research a browser behavior with multiple writes to the gzip compressed file
https://github.com/terales/multi-writes-to-gzipped-file

Last synced: about 2 months ago
JSON representation

[RESEARCH] Research a browser behavior with multiple writes to the gzip compressed file

Awesome Lists containing this project

README

        

### This is a [research code](https://meiert.com/en/blog/20140716/research-and-production/).

## Multiple writes to the same `xml` file with `compress.zlib://` stream would fail to decode in browsers if served via `readfile()`

* Issue: https://github.com/samdark/sitemap/issues/44
* Question on StackOverflow: https://stackoverflow.com/questions/45598939/multiple-writes-to-the-same-compressed-xml-file-would-break-it-in-browsers

#### Chrome, v60:

![image](https://user-images.githubusercontent.com/1920639/29138081-2c8890f4-7d4b-11e7-8162-a0b625f6df43.png)

#### Firefox, v54:

![image](https://user-images.githubusercontent.com/1920639/29138131-5a70c842-7d4b-11e7-9ebf-d484e4fe3b5b.png)

### How to reproduce

Sample files could be generated in `generate-files.php` and served via `serve.php`.

How to check this issue?

```sh
composer start-server

# in the other terminal
composer check
```

Try how different files served:

:x: http://localhost:8000/serve.php?file=multi

:heavy_check_mark: http://localhost:8000/serve.php?file=remulti

:heavy_check_mark: http://localhost:8000/serve.php?file=one