Other

Google PageSpeed Insights suggests "How To Optimize Your Site With GZIP Compression"

 In Apache, enabling output compression is fairly straightforward. Add the following to your .htaccess file:

# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

# Or, compress certain file types by extension:
<files *.html>
SetOutputFilter DEFLATE
</files>
 
Apache actually has two compression options:
  • mod_deflate is easier to set up and is standard.
  • mod_gzip seems more powerful: you can pre-compress content.
Deflate is quick and works, so I use it; use mod_gzip if that floats your boat. In either case, Apache checks if the browser sent the “Accept-encoding” header and returns the compressed or regular version of the file. However, some older browsers may have trouble (more below) and there are special directives you can add to correct this.
If you can’t change your .htaccess file, you can use PHP to return compressed content. Give your HTML file a .php extension and add this code to the top:

Verify Your Compression

Once you’ve configured your server, check to make sure you’re actually serving up compressed content.
  • Online: Use the online gzip test to check whether your page is compressed.
  • In your browser: Use Web Developer Toolbar > Information > View Document Size (like I did for Yahoo, above) to see whether the page is compressed.
  • View the headers: Use Live HTTP Headers to examine the response. Look for a line that says “Content-encoding: gzip”.
Be prepared to marvel at the results. The instacalc homepage shrunk from 36k to 10k, a 75% reduction in size.


Google PageSpeed Insights suggests "Leverage browser caching

# Browser Caching

FileETag MTime Size

<IfModule expires_module>
    ExpiresActive on
    ExpiresByType text/plain "access plus 1 week"
    ExpiresByType text/css "access plus 1 week"
    ExpiresByType text/javascript "access plus 1 week"
    ExpiresByType application/javascript "access plus 1 week"
    ExpiresByType application/x-javascript "access plus 1 week"
    ExpiresByType image/svg+xml "access plus 1 week"
    ExpiresByType image/gif "access plus 1 week"
    ExpiresByType image/png "access plus 1 week"
    ExpiresByType image/ico "access plus 1 week"
    ExpiresByType image/x-icon "access plus 1 week"
    ExpiresByType image/jpg "access plus 1 week"
    ExpiresByType image/jpe "access plus 1 week"
    ExpiresByType image/jpeg "access plus 1 week"
    ExpiresByType font/truetype "access plus 1 week"
    ExpiresByType application/x-font-ttf "access plus 1 week"
    ExpiresByType font/opentype "access plus 1 week"
    ExpiresByType application/x-font-otf "access plus 1 week"
    ExpiresByType application/font-woff "access plus 1 week"
    ExpiresByType application/vnd.ms-fontobject "access plus 1 week"
    ExpiresByType application/x-shockwave-flash "access plus 1 week"
    ExpiresByType application/x-httpd-php-source "access plus 1 week"
</IfModule>

Google PageSpeed Insights “Eliminate render-blocking CSS in above-the-fold content” 

 

A related question has been asked before: What is “above-the-fold content” in Google Pagespeed?
Firstly you have to notice that this is all about 'mobile pages'.
So when I interpreted your question and screenshot correctly, then this is not for your site!
On the contrary - doing some of the things advised by Google in their guidelines will things make worse than better for 'normal' websites.
And not everything that comes from Google is the "holy grail" just because it comes from Google. And they themselves are not a good role model if you have a look at their HTML markup.
The best advice I could give you is:
  • Set width and height on replaced elements in your CSS, so that the browser can layout the elements and doesn't have to wait for the replaced content!
Additionally why do you use different CSS files, rather than just one?
The additional request is worse than the small amount of data volume. And after the first request the CSS file is cached anyway.
The things one should always take care of are:
  • reduce the number of requests as much as possible
  • keep your overall page weight as low as possible
And don't puzzle your brain about how to get 100% of Google's PageSpeed Insights tool ...! ;-)
Addition 1: Here is the page on which Google shows us, what they recommend for Optimize CSS Delivery.
As said before, I don't think that this is neither realistic nor that it makes sense for a "normal" website! Because mainly when you have a responsive web design it is most certain that you use media queries and other layout styles. So if you are not gonna load your CSS first and in a blocking manner you'll get a FOUT (Flash Of Unstyled Text). I really do not believe that this is "better" than at least some more milliseconds to render the page!
Imho Google is starting a new "hype" (when I have a look at all the question about it here on Stackoverflow) ...!

 

Get 'tweet' event from Twitter Web Intents || alert message display ||link on twitter

https://dev.twitter.com/discussions/671


<?php if($ShareActive != 'N') {?>
<script src="//platform.twitter.com/widgets.js" type="text/javascript"></script>
    <a href="https://twitter.com/share" class="twitter-share-button" data-url="<?php if($ShareStaticPage == 'Y') {echo 'http://'.$SharePageLink;}?>" data-via="<?php echo $ShareAdminUserId; ?>" data-lang="en" data-text="<?php echo $SharePageName; ?>">Tweet</a>
<script>
  twttr.events.bind('tweet', function (event) {
alert('test');
  });
      twttr.events.bind('click', function(event) {
        var click_type = event.region;
alert(click_type);
    });
</script>
<?php } ?>
 

How to change php version in htaccess in server.

To switch to PHP 4.4:
AddHandler application/x-httpd-php4 .php
To switch to PHP 5.0:
AddHandler application/x-httpd-php5 .php
To switch to PHP 5.1:
AddHandler application/x-httpd-php51 .php
To switch to PHP 5.2:
AddHandler application/x-httpd-php52 .php
To switch to PHP 5.3:
AddHandler application/x-httpd-php53 .php
To switch to PHP 5.4:
AddHandler application/x-httpd-php54 .php


1 comment:

  1. There are many extra fresh titles find a way to|you probably can} browse should you head over to our “Slots” page. That is why we all know you’ll be happy to hear to} that we use the newest and most dependable 128-bit SSL technology. Deciding what's best for you actually a|can be a|is principally a} matter of desire, 1xbet but we imagine that some features are worth greater than others. Typical reloads on deposits of $45 and up obtain 150% on top as nicely, making BigSpin very a lot the lord of the day by day promotion. We also loved its weekly mystery bonus that landed in our inbox every Thursday.

    ReplyDelete