Ajax field validation and optimization problems

8 years 1 month ago #280088 by activha
Hello

We are trying to accelerate and minimize our website using tools like jch optimize.

These tools work well with your extensions except of your ajax fields validation system which is using random strings for spooffield and spam string

Doing this way generates one cache js file per view instead of getting one js file reusable on several pages. Cache content would increase and increase, and the js file would be generated again at each page view, thus slowing the website instead of speeding it.

Is there another way to validate ajax fields than these random strings ?
Could you wrap the generate CB scripts so that we can exclude them ?
Could you provide a way to defer CB js at bottom so that website would be accelerated with main js cache file deferred too ?

Thanks for your hints
Jean

Please Log in to join the conversation.

8 years 1 month ago #280090 by krileon
You're trying to cache the selector binding the jQuery validate. We send configuration variables with the binding. The spoof checking is sent with that as it's per page based. There is no changing this behavior and no plans to change this behavior. You really only need to be caching the files themselves.

Is there another way to validate ajax fields than these random strings ?

No, they're security strings.

Could you wrap the generate CB scripts so that we can exclude them ?

Wrap them? With what?

Could you provide a way to defer CB js at bottom so that website would be accelerated with main js cache file deferred too ?

No, JS reads top to bottom. This would entirely alter our entire JS usage and loading order and potentially break all of CB. The scripts belong in the header and no plans of changing this, sorry.

Sorry, but your issue seams more like a problem with JCH Optimize than CB. Sending generated values with a selector isn't abnormal by a long shot. JCH Optimize would need to be able to handle those cases or at least let you specify exclusions.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

8 years 1 month ago #280093 by activha
OK you're right, no purpose going too far

We'll keep optimizing and browser caching only the static template and system files, that should be enough :-)

Please Log in to join the conversation.

8 years 1 month ago #280095 by krileon
Yup, I highly recommend only caching static pages that don't change often otherwise you risk issues with data being out of date. In dynamic environments caching gets a bit complicated as some things can cache while others can't. I also recommend not caching forms or form endpoints as they often contain security strings sent with the POST.

Browsers do pretty good caching CSS and JS files themselves. There are optimizers that can merge them into a single file, but from my experience they don't work well and often break the JS.

Eventually we'll have a new CBLib API for better dealing with cache internally and automatically. Currently this is done often by static variables to avoid duplicate calls, etc.. However with an API library that can properly use PHP caching or fallback static variable caching we can improve this further. That's for a later CB release though.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.235 seconds

Facebook Twitter LinkedIn