Jump to content

Manifest caching


Adlago

Recommended Posts

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.

Link to comment
Share on other sites

3 minutes ago, bfarber said:

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.

Link to comment
Share on other sites

4 minutes ago, Adlago said:

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.

Link to comment
Share on other sites

4 minutes ago, Adlago said:

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.

Link to comment
Share on other sites

6 minutes ago, sudo said:

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

Link to comment
Share on other sites

19 minutes ago, Adlago said:

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.

Link to comment
Share on other sites

23 hours ago, Adlago said:

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

Link to comment
Share on other sites

39 minutes ago, bfarber said:

$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.

Link to comment
Share on other sites

48 minutes ago, Adlago said:

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.

Link to comment
Share on other sites

2 hours ago, Adlago said:

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.

Link to comment
Share on other sites

10 hours ago, Martin A. said:

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:

On 8/21/2019 at 9:57 PM, Adlago said:

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.

 

Link to comment
Share on other sites

3 hours ago, Adlago said:

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.

Link to comment
Share on other sites

15 minutes ago, sudo said:

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?

Link to comment
Share on other sites

5 hours ago, bfarber said:

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.

Link to comment
Share on other sites

  • 2 years later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...