Analisis Teknik Optimasi Website Terhadap Hasil Pencarian Google

67

LAMPIRAN 1

SCRIPT HTACCESS


ExpiresActive On
ExpiresDefault "access plus 1 month"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/html "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType application/x-javascript "access plus 14 days"
ExpiresByType image/x-icon "access plus 1 year"




Header set Cache-Control "max-age=2592000, public"


Header set Cache-Control "max-age=604800, public"


Header set Cache-Control "max-age=216000, private"


Header set Cache-Control "max-age=216000, public, must-revalidate"


Header set Cache-Control "max-age=1, private, must-revalidate"

Header unset ETag

FileETag None

68


LAMPIRAN 2

SCRIPT PENGOPTIMALAN GAMBAR

function replaceimages_get_images($content) {
global $post;
$images = array();
$x = 0;
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => $post->ID,
'exclude' => get_post_thumbnail_id()
);
$attachments = get_posts( $args );
if ( $attachments ) {
foreach ( $attachments as $attachment ) {
$src = wp_get_attachment_image_src( $attachment->ID, 'full' );

$title = apply_filters( 'the_title', $attachment->post_title );
$alt
=
apply_filters(
'alt',
get_post_meta($attachment->ID,
'_wp_attachment_image_alt', true ));
$images[$x] = '';
$x++;
}
}
return $content;
}
add_filter( 'the_content', 'replaceimages_get_images' );

69

LAMPIRAN 3

SCRIPT MOBILE FRIENDLY