Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted August 21, 20195 yr 5 months ago I created such a topic in Client Lounge I confirmed @bfarber moving the topic to this section - but this does not seem to have happened. This file is rarely changed. The cache does not need to be only 24 hours. This is probably fixed in the output php or somewhere else. This expires time cannot be changed with a htaccess file - I've tried all the options found on the web. Please put in ACP an option to change expires time to this cache. Thanks.
August 22, 20195 yr Author What is your recommendation for the caching period? I'm not sure because all the experiments I've done with the htaccess file do not change the expires time. If I trust these recommendations here - the expiration time should be 0 seconds. But even these tips implemented in htaccess file do not change the expires time. If you point me to which file I make a change - I could experiment and write here for a result.
August 22, 20195 yr I'm not sure because all the experiments I've done with the htaccess file do not change the expires time. If I trust these recommendations here - the expiration time should be 0 seconds. But even these tips implemented in htaccess file do not change the expires time. If you point me to which file I make a change - I could experiment and write here for a result. So it should never be cached at all? that's what those settings are.
August 22, 20195 yr Author So it should never be cached at all? that's what those settings are. That's how experts advise - not just on the site linked. Personally, I would try for a 1 month expiration time.
August 22, 20195 yr That's how experts advise - not just on the site linked. Personally, I would try for a 1 month expiration time. Can you possibly link the recommendation? That site you linked is an htaccess to fix a specific problem with a certain document, he could have copy/pasted from another site which is where the manifest time was set rather than a specific recommendation for manifests. If the manifest url supports querystring then you could cache it for ages and if it gets tweaked the querystring could cache bust potentially.
August 22, 20195 yr Author Can you possibly link the recommendation? That site you linked is an htaccess to fix a specific problem with a certain document, he could have copy/pasted from another site which is where the manifest time was set rather than a specific recommendation for manifests. If the manifest url supports querystring then you could cache it for ages and if it gets tweaked the querystring could cache bust potentially. I add in my htaccess file # Manifest files AddType application/manifest+json webmanifest AddType application/x-web-app-manifest+json webapp AddType text/cache-manifest appcache <IfModule mod_expires.c> # Manifest files ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds" ExpiresByType text/cache-manifest "access plus 0 seconds" </IfModule> I tried with 1 week, 1 month - also without change. My manifest file is in root directory with permissions 0644
August 22, 20195 yr I add in my htaccess file # Manifest files AddType application/manifest+json webmanifest AddType application/x-web-app-manifest+json webapp AddType text/cache-manifest appcache <IfModule mod_expires.c> # Manifest files ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds" ExpiresByType text/cache-manifest "access plus 0 seconds" </IfModule> I tried with 1 week, 1 month - also without change. My manifest file is in root directory with permissions 0644 PHP can override this.
August 23, 20195 yr If you point me to which file I make a change - I could experiment and write here for a result. $cacheHeaders = ( \IPS\IN_DEV !== true AND \IPS\Theme::designersModeEnabled() !== true ) ? \IPS\Output::getCacheHeaders( time(), 86400 ) : array(); Line 174 applications/core/modules/front/system/metatags.php
August 23, 20195 yr Author $cacheHeaders = ( \IPS\IN_DEV !== true AND \IPS\Theme::designersModeEnabled() !== true ) ? \IPS\Output::getCacheHeaders( time(), 86400 ) : array(); Line 174 applications/core/modules/front/system/metatags.php With 1 week (604800) value is perfect. I did a test with several test servers.
August 23, 20195 yr With 1 week (604800) value is perfect. I did a test with several test servers. Tbh I wouldnt hard cache it unless it has querystring busters for when you need to push an update even though that wont be often.
August 23, 20195 yr Author Tbh I wouldnt hard cache it unless it has querystring busters for when you need to push an update even though that wont be often. I'm not sure what you are saying. Please explain. Thanks
August 23, 20195 yr I'm not sure what you are saying. Please explain. Thanks What he's saying is that one week is quite a long while to cache something without a "cache buster" in the request URL. The cache buster is the string of random characters you see in the CSS and JS requests, and it is used to detect changes to the file. When a file changes, the cache buster changes, and it will thus look like a new file to those who have cached it. The manifest file does not have that added to the URL, and with a week of cache time any changes to the manifest may take up to week to take effect.
August 24, 20195 yr Author What he's saying is that one week is quite a long while to cache something without a "cache buster" in the request URL. The cache buster is the string of random characters you see in the CSS and JS requests, and it is used to detect changes to the file. When a file changes, the cache buster changes, and it will thus look like a new file to those who have cached it. The manifest file does not have that added to the URL, and with a week of cache time any changes to the manifest may take up to week to take effect. I know that. Therefore, the main idea of this topic is: Please put in ACP an option to change expires time to this cache. That's what I researched and wrote. On my site, an expiration time of 1 week is good. If I make changes to this file, I can still turn on 0 seconds and make changes, once I see well-functioning new things, I will still include 1 week. But if the cache expires time for this file exists as an option with values of 0 sec 1 day 1 week and 1 month, it will be easy and convenient for any administrator to make their choice.
August 24, 20195 yr I know that. Therefore, the main idea of this topic is: That's what I researched and wrote. On my site, an expiration time of 1 week is good. If I make changes to this file, I can still turn on 0 seconds and make changes, once I see well-functioning new things, I will still include 1 week. But if the cache expires time for this file exists as an option with values of 0 sec 1 day 1 week and 1 month, it will be easy and convenient for any administrator to make their choice. If you change it to 0 seconds after making a change the browsers that have it cached wont see the change for a week. Querystring cache busting is great, we are a vb 4 site currently and I have made significant changes to it where almost all the the resources/static files are cached for a while but I change one variable and the cache busting kicks in. I dont disagree with you regarding changing it to a week etc, I am more noting it would be a good idea if IPB put a cache busting querystring on it when they make the change to minimise headaches for others.
August 24, 20195 yr Author I dont disagree with you regarding changing it to a week etc, I am more noting it would be a good idea if IPB put a cache busting querystring on it when they make the change to minimise headaches for others. I do not propose a fixed for 1 week - but the addition of an option in ACP with an expiration time at the discretion of the administrator. When was the last time you modified your manifest file?
August 26, 20195 yr I'll be honest - I don't think we need configuration options for how long to cache the manifest file. I'm not opposed to adjusting the caching and using sensible values, however, so thank you for the information. We can discuss it further internally and make decisions as to whether or not to change it.
August 26, 20195 yr Author I'll be honest - I don't think we need configuration options for how long to cache the manifest file. I'm not opposed to adjusting the caching and using sensible values, however, so thank you for the information. We can discuss it further internally and make decisions as to whether or not to change it. I suggested it be an option in ACP, as I assumed there would be objections, as it happened. This resource very rarely changes after its creation. I have run expires time tests of 2 days, 3 to 6 days, but the only minimum expires time for this resource is 1 week is considered correct by several test servers - GtMetrix, WebPageTest and others. If you decide that this exipres time should be fixed, then it should be 1 week.
September 22, 20213 yr I'm treating the file as a static file and I cache it in cloudflare. The point is that this single used to extend page load by 1 second. Since I purge cloudflare cache almost daily I get a fresh copy every day. Regards