How to ignore URL query parameters from cached urls?

Both mod_httapi and mod_http_cache appear to generate a hash based on the enrire URL, including query parameters, and use that as the filename for the cached file.

This works fine in most cases, but is a problem when cahcing files from AWS S3 using presigned URLS. This is because the query parameters are different each time a specific file is requested, resulting in the same file being cached multiple times, with a different name.

Is there a way of instructing mod_httapi or mod_http_cache to ignore the URL query parameters and, instead, use only the main URL (everything left of the ‘?’)?

For example, given the URL string “https://somedomain.com/files/sound.wav?data=1234&key=5678”, I want to cache the downloaded file using only “https://somedomain.com/files/sound.wav” to generate the cached filename

Thanks

Not currently, but why are you adding the params currently?

/b

I’m using presigned URLs to download files from AWS S3 and the signature info is generated as URL query parameters. Everytime I download a file I need to generate a new presigned URL, so, for the same S3 file, I end up with potentially lots of different query params, which results in lots separate of cached instances of the same file.

https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-presigned-urls.html

BTW: presigned URL usage is kind of imposed on me as S3 keys are not used in the envioment for security reasons (I’m not quite sure or all the details, but keys are unavailable)