• Resolved clickharder

    (@clickharder)


    We currently do not have TranslatePress enabled on the site because it is causing a really high time to first byte. Our TTFB is generally around 1 second (still rather high) but when we enable TranslatePress the TTFB jumps to over 4 seconds.

    This is due to a lot of content, products, etc on our website.

    We thought we had the problem solved with the following code:

    <?php
    
    /*
    Plugin Name: TranslatePress - Disable Gettext Translation on default language
    Plugin URI: https://translatepress.com/
    Description: Disable Gettext Translation on default language to reduce page load time
    Version: 1.0.0
    Author: Cozmoslabs, Razvan Mocanu
    Author URI: https://cozmoslabs.com/
    License: GPL2
     */
    
    if ( class_exists( 'TRP_Translate_Press' ) ) {
    	add_filter( 'plugins_loaded', 'trpc_disable_gettext_translation', 10 );
    	function trpc_disable_gettext_translation( $run_or_not ){
    		global $TRP_LANGUAGE;
    		$trp = TRP_Translate_Press::get_trp_instance();
    		$trp_settings = $trp->get_component( 'settings' );
    		$settings = $trp_settings->get_settings();
    		$default_language = $settings["default-language"];
    
    		if ( $TRP_LANGUAGE == $default_language ) {
    			$translation_manager = $trp->get_component( 'translation_manager' );
    			$translation_render = $trp->get_component( 'translation_render' );
    
    			remove_action( 'init', array( $translation_manager, 'create_gettext_translated_global' ) );
    			remove_action( 'admin_init', array( $translation_manager, 'create_gettext_translated_global' ) );
    			remove_action( 'init', array( $translation_manager, 'apply_gettext_filter_on_frontend' ) );
    			remove_action( 'admin_init', array( $translation_manager, 'apply_gettext_filter' ) );
    			remove_action( 'shutdown', array( $translation_manager, 'machine_translate_gettext' ) );
    
    			remove_action( 'date_i18n', array( $translation_manager, 'handle_date_i18n_function_for_gettext' ) );
    			remove_action( 'clean_url', array( $translation_manager, 'trp_strip_gettext_tags_from_esc_url' ) );
    			remove_action( 'sanitize_title', array( $translation_manager, 'trp_sanitize_title' ) );
    
    			remove_action( 'gettext_with_context', array( $translation_render, 'fix_wptexturize_characters' ) );
    		}
    
    		return $run_or_not;
    	}
    }

    Unfortunately, our times haven’t decreased significantly.

    We did make a minor code change to the original source to check to see if TranslatePress is active. Otherwise we have to be very careful when we activate/deactivate plugins because a fatal error can be generated.

    This is a multi-site install running 4 websites. Server has 8GB of RAM and 4 processors running PHP 7.x so I don’t think it is server issue.

    Any suggestions would be appreciated.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Georgian Cocora

    (@raster02)

    Hello @clickharder,

    Please open a ticket on our website so my colleagues can investigate.

    Regards.

    Thread Starter clickharder

    (@clickharder)

    I did on 3/26/2019

    Hello @clickharder
    Did you manage finally to solve this?
    I am about to go pro but I heard that some of the add ons like automatic language detection, add extra load time.
    Do you have the free version or a premium one.
    Would you be so kind to share a few thoughts about that?
    Best regards,
    F.

    Thread Starter clickharder

    (@clickharder)

    Hi @filoumenos,

    I don’t know the answer to your questions on the pro version. I am assuming it uses the same methods as the free so the problem will remain.

    I hate to say it, because the support from TranslatePress is good when you can get it, it is just sometimes hard to get. So far, I received the plugin that generated the above code, but no other support on this problem.

    Also, the problem isn’t solved with the above code. On large sites, I see my TTFB shoot up to 4-6 seconds, which isn’t acceptable for obvious reasons.

    Hi,

    I noticed this too and decided to use a caching system. W3 Total Cache works for me.
    Did you try this road? Sure there could be many reasons not to use a cache …

    Best
    Steff

    Thread Starter clickharder

    (@clickharder)

    @sthuber

    Yes, I do use caching plugins on nearly all my sites. There are a couple of edge cases where I can’t.

    But using caching plugins is more of a band-aid than solving the underlying problem of high server response times.

    @clickharder yes, that’s true. Using plugins is a band-aid and not a permanent solution.
    And one more think that concerns me is the add-ons of the plugin. With them, even more extra code will be added to the page’s load time. Maybe if you do not have a lot of content for translation, the best thing to do is to set up a multisite. It is more flexible, without the any plugin’s performance degrades.
    On my side I am a little bit confused about what to do, as I was thinking to go premium. And probably I will so I ‘ll check it and let you know.
    Anyways, good luck and thank you for all the info.
    Wishing the best,
    F.

    • This reply was modified 5 years, 7 months ago by filoumenos.
    Plugin Author Cristian Antohe

    (@sareiodata)

    Hi,

    The last version of TP had quite a few speed optimizations.

    Can you please try with the last version and see if that makes a difference in your use case?

    i have also notice this. But what can you do about this.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘High TTFB on sites with a lot of content’ is closed to new replies.