My WordPress website stopped displaying images in my portfolio. When O logged in to the CP, I see this error {"code":0,"url":""} in many places like: when load official wp feeds, when try to add blocks, when try to add images or edit pages.
Do you have any suggestion?
I did google it without any solution.
Thanks
You may want to try adding this to the top of your .htaccess file,
I had the same issue and this resolved it:
## EXPIRES CACHING ##
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
## EXPIRES CACHING ##
This should help page load in the future too!
These file types will be cached in order to improve faster loading times in the future.
Hope that helps.
Also if Yahoo is okay leave it be unless you start to get the same error.
Related
I have a problem with polylang.
For example, the default language is PL and additional EN and DE. Everything is good, but when you switch to EN and close the browser, after entering the main domain again, EN is active. Clicking on PL it does not want to switch anything and in the address bar is always www.mypage.pl/en/. Even if I remove it from the address en it goes back to it.
Cleaning cookies in the browser does not give anything.
What may be the problem? How to fix it?
Thanks in advance for reply.
ok, I solved the problem by removing the following code from the htaccess file:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
According to www.gtmetrix.com 2 components are without a far-expiration date:
I added at the end of my .htaccess
ExpiresActive on
ExpiresDefault "access plus 1 month"
"access plus 1 month"
# Web fonts
# Collection
ExpiresByType font/collection "access plus 1 month"
# Embedded OpenType (EOT)
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
ExpiresByType font/eot "access plus 1 month"
# OpenType
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType font/otf "access plus 1 month"
# TrueType
ExpiresByType application/x-font-ttf "access plus 1 month"
ExpiresByType font/ttf "access plus 1 month"
# Web Open Font Format (WOFF) 1.0
ExpiresByType application/font-woff "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType font/woff "access plus 1 month"
# Web Open Font Format (WOFF) 2.0
ExpiresByType application/font-woff2 "access plus 1 month"
ExpiresByType font/woff2 "access plus 1 month"
# Other
ExpiresByType text/x-cross-domain-policy "access plus 1 week"
and nothing happens. What can I do to set for these two componets expiration dates?
The scripts are from third party, not from you server. You have no control to add the expires headers.
optimize speed.
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# Default directive
ExpiresDefault "access plus 1 month"
# My favicon
ExpiresByType image/x-icon "access plus 1 year"
# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 month"
# Javascript
ExpiresByType application/javascript "access plus 1 year"
</IfModule>
I have a website WeeTech Solution. And whenever i check my website on “GT Matrix” is show me the number of issue like...
• https://www.weetechsolution.com/css/content_slider_style.css (expiration not specified)
How to fix this issue?
you have to add this code in your htaccess file.
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
If your site in html & php then you can use .htaccess file with below code and upload this .htaccess file to main root.
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
If your site in .Net then yo can use staticContent inside Web.config file
code given below
<staticContent>
<clientCache cacheControlCustom="public" cacheControlMaxAge="24:00:00" cacheControlMode="UseMaxAge" />
</staticContent>
im building a new site and i'm trying to improve its speed and page rank. One of the problems i have is Leverage browser caching. I've read online different solutions, but none of them seems to work for me. I edited the .htaccess file and added the following code:
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
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/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
</IfModule>
## EXPIRES CACHING ##
I still cannot fix the error. Also, Gtmetrix report shows that the problem is only with my front page images. (I'm using wordpress and front page is a static page).
Is there a way to add expiry header to specific files by location ?
Thanks in advance :)
That codes works only in apache service.
please inter your website address.
for more information:
https://gtmetrix.com/leverage-browser-caching.html
https://developers.google.com/speed/docs/insights/LeverageBrowserCaching
I have just resolved it. You have to enable mod_expires module. Have a look on my answer :- Leverage browser caching not working - Htaccess & mod_expires Active
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm told I should cache the above resources in order to optimise my site, but I can't seem to find/understand instructions for doing so. What are the manual instructions for caching this info, and where do I put them?
Use .htaccess for compressing and caching. Add this to your .htaccess. Please backup your .htaccess before doing this (Just for safety). This will apply to all cacheable resources.
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
You can use a Content Delivery Network (CDN) for this as well.
CDN will speed up your site loading time.
Please take a look in here for a better understanding :
http://premium.wpmudev.org/blog/top-cdn-services-to-make-your-wordpress-site-blazingly-fast/