• Resolved erisal

    (@erisal)


    I’d have preferred that this be done by the plugin but since it’s not, I’m forced to add a line in the .htaccess file so that my JSON manifest file can be cached. I added this: ExpiresByType application/json A31557600.
    Wouldn’t it be possible to add a function in the plugin or use a hook?

Viewing 13 replies - 1 through 13 (of 13 total)
  • json is a static source like CSS, Javascript and is not cachable by any HTTP cache. Static sources are cached by browser cache not by webserver/LScache plugin, but LiteSpeed webserver stores compressed static sources to deliver such sources faster to the client.

    Thread Starter erisal

    (@erisal)

    In the WordPress back office, go to “LiteSpeed Cache”, then select “Cache” and click on the “Browser” tab. Enabling the browser cache adds a code area in the .htaccess file: “marker BROWSER CACHE”.
    What I’m asking: is it possible to add the line of code that I indicated in my previous message in order to make the manifest file cacheable (by the browser)?
    Or, is it possible to provide a hook that would add this code?

    Such question is asked almost daily. Have you already heard about search function? ??

    https://www.ads-software.com/support/topic/manifest-not-caching/

    Thread Starter erisal

    (@erisal)

    I’m sorry to annoy you but as you can see I considered your suggestion to add the code line in my .htaccess file. My question here concerns another subject: why not have it added by your plugin, following all those you create when activating the browser cache? Thus, json files will be treated by the browser cache just like other files. It was just a suggestion … have a nice day.

    Refer to my first answer. json is a static source and static sources may not be cached because caching of static sources is already defined in HTTP protocol. Every browser can cache static sources, so why extra define in cache plugin?

    Thread Starter erisal

    (@erisal)

    I’m sincerely sorry because I don’t practice good english (I’m french) and maybe I’m misunderstood. So if I may, here’s a question: Do you think an image file or a pdf file or a text file are considered static sources already defined in HTTP protocol ?
    Best Regards,

    Do you think an image file or a pdf file or a text file are considered static sources already defined in HTTP protocol ?

    Yes! But you can control/modify how long static sources should be cached.

    https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
    https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires

    Thread Starter erisal

    (@erisal)

    Well, and is that what is done by your plugin when the browser cache is enabled? This adds ExpiresByType directives in the htaccess file, is that correct?

    This is not my plugin. I am a user like you… ??

    json sources currently have no extra expires header in cache plugin, but should be added to the current defines. That’s why I linked to the post on the other site. Follow these instructions and you get everything you want.

    Thread Starter erisal

    (@erisal)

    I’m confused you aren’t the person I thought but thanks anyway for participating even though I don’t know anything more than I already knew. My question is therefore unanswered and I’m waiting for an intervention from a support team…

    Thread Starter erisal

    (@erisal)

    Is it possible to add a ExpiresByType directive for json files in the htaccess file like those added by activating the browser cache ?

    You don’t need a directive. You only have to add a header to define expire header for json in .htaccess.

    The answer you want to get is from plugin support:

    https://www.ads-software.com/support/topic/manifest-not-caching/

    Thread Starter erisal

    (@erisal)

    Hi,
    if a moderator goes through this, please delete this thread which doesn’t add anything and is duplicated with another.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘The manifest file isn’t cacheable’ is closed to new replies.