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

[PREF]: "underscore_keys" filter #226

Open
mountainash opened this issue Oct 23, 2024 · 0 comments
Open

[PREF]: "underscore_keys" filter #226

mountainash opened this issue Oct 23, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@mountainash
Copy link

Requests to the Cockpit /page APIs often return a very large results as there's
many keys and values that are rarely used. Adding an easy way to remove them would reduce the payload size, transfer time and processing. Can I suggest that a single/simple filter is added to remove the following fields (aka the “underscore_keys”):

  • _hash
  • _created
  • _modified
  • _cby
  • _mby
  • _state
  • _id
  • _meta
  • _pid
  • _o
  • many more?

The filter could also remove the “image meta data” (as it’s also not often used). This would remove the following image child fields:

  • type (the mime contains almost duplicate data)
  • title (often this is just the filename)
  • size
  • colors
  • folder

Obviously calling the new filter combined with an explicit filter:{colors:1,_state:1} would re-add those key/values.

This often results in a 30+% size saving!

@aheinze aheinze added the enhancement New feature or request label Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants