# Optimizing Site Speed

Page speed depends on many factors such as server resource, amount of site images, amount of site visitor, external assets and etc.

In this article, we will describe how to quickly improve your site speed with some lightweight  and effectively plugins

### Regenerate thumbnails

When you changing a theme, Maybe your images are not being displayed incorrect size and the full image will be loaded.\
This will increase the site size and also reduce the time load.

For further information, Refer to: [Images are not displaying consistent in size](/age/other-settings/tips-and-questions/images-are-not-displaying-consistent-in-size.md).

### Minify all scripts and styles

To getting started, Follow steps below:

1. Install and activate the plugin: <https://wordpress.org/plugins/autoptimize/>
2. Navigate to **Settings -> Autoptimize**&#x20;
3. Checked on "**Optimize JavaScript Code?"**
4. Checked on "**Optimize CSS Code?"**
5. Checked on "**Optimize HTML Code?"**
6. Checked on "**Misc Options"**
7. Leave other options as the default to avoid bugs if you are not sure what is it.

### Adding Cache Plugin

Cache plugin will improve your website performance and help your site reduce the response time.

To getting started, Follow steps below:

1. Install and activate the plugin:[ https://wordpress.org/plugins/wp-super-cache/](https://wordpress.org/plugins/wp-super-cache/)
2. Navigate to **Settings -> WP Super Cache**
3. Select **Caching On (Recommended)** in the Caching option.

### Add Expires headers

To enable browser caching, you’ll need to edit — or perhaps even create — a file called the **.htaccess** file. This is a file in the root folder on your hosting.

To getting started, Follow steps below:

1. Access to your hosting file manager and find the **.htaccess** file
2. Open the file, then copy the code below and paste it at the end of your .htaccess file content. Don’t make any other changes in the file.

```
#Expires cache 

ExpiresActive On
ExpiresByType text/html "access 600 seconds"
ExpiresByType application/xhtml+xml "access 600 seconds"
ExpiresByType text/css "access 1 month"
ExpiresByType text/javascript "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/javascript "access 1 month"
ExpiresByType application/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresDefault "access 1 month"


#Expires cache end
```

{% hint style="info" %}
You can also contact the hosting support, they will help you in this matter.
{% endhint %}

### Using a CDN for Your Website

If your pages are filled with images and want your images to load faster, you can (and should) use content delivery networks (which are commonly referred to as CDNs).

We recommend you to use Cloudflare. This service will speed up your site more than 10x faster and improve score. Please read documentation below for further information.

{% hint style="info" %}
[How to Install Cloudflare on Your WordPress Site](https://kinsta.com/knowledgebase/install-cloudflare/)
{% endhint %}

### Checking Your Work

You can test your site with some services below:

* <https://gtmetrix.com/>
* <https://tools.pingdom.com/>
* <https://developers.google.com/speed/pagespeed/insights/>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tmrwstudio.gitbook.io/age/other-settings/tips-and-questions/optimizing-site-speed-and-google-pagespeed-insights.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
