Skip to content

Fastify etag bringing QPS down for paths where dummy etags have been added #106

@kp198

Description

@kp198

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.15.0

Plugin version

4.2.0

Node.js version

16.5.1

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

12.6.5

Description

I used the fastify etag plugin and for the url paths where I did not require etag I added a dummy etag but the QPS for both the paths decreased significantly after adding the plugin

I also tried generating etag myself and this seemed to be give me better QPS. Any reasons for this strange behaviour or is this expected?

const hash = crypto.createHash('sha256');
const stringDoc: string = JSON.stringify(documentData);
etag = hash.update(stringDoc).digest('hex');

Steps to Reproduce

Add reply.raw.setHeader(etag, 'dummyetag'); to one path's reply and check if there is a drop in QPS

Expected Behavior

The QPS should not decrease for paths that already have etag headers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions