Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move etags caching config to plugin options #34

Closed
hueniverse opened this issue Aug 7, 2015 · 0 comments
Closed

Move etags caching config to plugin options #34

hueniverse opened this issue Aug 7, 2015 · 0 comments
Assignees
Milestone

Comments

@hueniverse
Copy link
Member

@hueniverse hueniverse commented Aug 7, 2015

hapi 9.0 drops support for etagsCacheMaxSize.

This is the old test.

    it('does not cache etags', function (done) {

        var server = new Hapi.Server({ files: { etagsCacheMaxSize: 0 } });
        server.register(Inert, Hoek.ignore);
        server.connection({ routes: { files: { relativeTo: __dirname } } });
        server.route({ method: 'GET', path: '/note', handler: { file: './file/note.txt' } });

        server.inject('/note', function (res1) {

            expect(res1.statusCode).to.equal(200);
            expect(res1.result).to.equal('Test');
            expect(res1.headers.etag).to.not.exist();

            server.inject('/note', function (res2) {

                expect(res2.statusCode).to.equal(200);
                expect(res2.result).to.equal('Test');
                expect(res2.headers.etag).to.not.exist();
                done();
            });
        });
    });
@hueniverse hueniverse self-assigned this Aug 7, 2015
@hueniverse hueniverse added this to the 3.0.0 milestone Aug 7, 2015
@kanongil kanongil closed this in 835c8f8 Aug 8, 2015
kanongil added a commit that referenced this issue Aug 8, 2015
Move config to plugin options from hapi server. Closes #34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.