• Resolved ianatkins

    (@ianatkins)


    Hello.

    Thanks for the great plugin.

    We’ve run into a couple of performance issue. Have noticed the search form is invalidating our page cache, causing a static page cache to be generated every page load ( using LiteSpeed ).

    Looks like you’re generating a unique id on line 52 of class-aws-markup.php for the search input field, on each page load.

    And also including the current page ID in the markup ( data-page-id ) – which looks to be unused elsewhere in the code?

    Anyway that could be refactored to be more static caching friendly?

    Thanks.

    Ian.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hi,

    About data-page-id attribute – it is not used by the plugin itself. But it can be used via custom code snippet and can be useful in some cases.

    Unique id is generated for search input label. Label is not visible but some html validators show notices if the input field doesn’t have a label. In fact you can use the following code snippet to just remove this label:

    add_filter( 'aws_searchbox_markup', 'my_aws_searchbox_markup' );
    function my_aws_searchbox_markup( $markup ) {
        $markup = preg_replace( '/id="(.)+?"/i', '', $markup );
        $markup = preg_replace( '/<label[\S\s]*?<\/label>/i', '', $markup );
        return $markup;
    }

    Regards

    Thread Starter ianatkins

    (@ianatkins)

    Great thanks, I missed that filter when reviewing the code.

    That’s ideal, thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search input ID is unique every page load’ is closed to new replies.