Inline variable exlusion – optimisation issues
-
Hey Phil!
I have been working heavily on optimising our page with litespeed plugin connected to a CDN and my limited PHP knowledge is stopping me from generating a public cache for pages. I would try the V3 to see if that would solve my problem but unfortunately I do not meet PHP version requirements so at the moment I am stuck with the previous version… I can not seem to exclude this variable from caching as a vary:
</label></p><input type=”hidden” name=”age_gate[age]” value=”TVRnPQ==” /><input type=”hidden” name=”action” value=”age_gate_submit” /><input type=”hidden” name=”age_gate[nonce]” value=”832ce7b546” /><input type=”hidden” name=”_wp_http_referer” value=”/product-category/e-liquid/xxx/” /><input type=”hidden” name=”confirm_action” value=”0″ /></form></div></div>
As you can imagine every time the age gate is generating 832ce7b546 new page is being made making the cache useless. I had a very similar issue with another plugin called WCPA that generated values inlined but I managed to make a vary entry in my .htaccess file forcing it as a “random” unique so my public cache remains intact.
The code after looked like this:var wcpa_global_vars = {"wc_currency_symbol":"\u00a3","wc_thousand_sep":",","wc_price_decimals":"2","wc_decimal_sep":".","price_format":"%1$s%2$s","wc_currency_pos":"left","date_format":"F j, Y","date_format_js":"MMMM D, YYYY","time_format":"g:i a","time_format_js":"h:mm a","use_sumo":"","start_of_week":"1","today":{"days":18713,"seconds":1616834724},"google_map_api":"","google_map_countries":"","ajax_url":"https:\/\/xxxxxxxx.xx.xx\/wp-admin\/admin-ajax.php","change_price_as_quantity":"","show_field_price_x_quantity":"","show_strike_product_price":"","strings":{"ajax_file_upload":"Files are being uploaded...","ajax_upload_error":"Upload error","sel_min_req_error":"You have to select minimum %d items","sel_max_req_error":"You can select maximum %d items","fix_val_errors":"Please correct the errors shown for fields","field_is_required":"This field is required","character_not_valid":"Character %s is not supported","sumo_strings":{"captionFormat":"{0} Selected","captionFormatAllSelected":"All {0} selected!"}},"wcpa_init_triggers":["qv_loader_stop","quick_view_pro:load","elementor\/popup\/show","xt_wooqv-product-loaded","woodmart-quick-view-displayed","porto_init_countdown"]};
So that was straightforward – I grabbed the identifier and made a caching rule that looked like this:
RewriteEngine on
RewriteRule .* – [E=Cache-Vary:wcpa_global_vars]If the 832ce7b546 was identified as something else other than
value=””
I would probably put it inside the same scheme and forget about it but this identifier is too generic and it is used across multiple functions so I can not possibly use it.
In the code I have noticed
name=”age_gate[nonce]”
and I thought – oh, great, I can put it through ESI content that is private for every user but that made no difference. The code is still there and it is being inlined into the page.
Any insight into my issue would be greatly appreciated. ??
- The topic ‘Inline variable exlusion – optimisation issues’ is closed to new replies.