• Currently worker goes through all parameters in THIRD_PARTY_QUERY_PARAMETERS and uses regexp for comparison.

    Also it matches one letter parameters almost always (i.e. “e” for “MarketPlace”).

    I would like to propose changing they way around it to only process qs parameters in request.

    This can reduce CPU lifecycles on the worker.

    		reqURL.searchParams.forEach((value: string, key: string) => {
    			let res = PROMO_QUERY_PARAMETERS.indexOf(key) !== -1;
    
    
    			if(res) {
    				reqURL.searchParams.delete(key);
    			}
    		});
Viewing 1 replies (of 1 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Hi,
    Firstly if you would like to modify the worker code there is already a way to overwrite the worker script. Check the advanced section under FAQ tab inside the plugin settings for the steps.

    Alternatively, now I generally recommend people to use Cache Rule instead of Worker as it’s more customizable and easy to manage. Guide: https://gist.github.com/isaumya/af10e4855ac83156cc210b7148135fa2

    Depending on your requirement, use the one that suites you.

Viewing 1 replies (of 1 total)
  • The topic ‘Worker template incorrect regexp’ is closed to new replies.