• Resolved millerleon

    (@millerleon)


    Hi,

    I’m experiencing an issue when using this plugin and a specific permalink setting. The situation is as follows:

    • User 1 uploads a file: Revision-1, and sees Revision-1 when downloading it
    • User 2 presses the download link and also sees Revision-1 (so far so good)
    • Now user 1 uploads a new revision, lets say, Revision-2
    • And user 1 presses the download link, and sees Revision-2
    • But, when User 2 presses the download link and also expects to see Revision-2, he will instead get Revision-1

    This is with the permalinks in the “post name” setting. It seems to be working correctly when using the default “plain” setting. The user role doesn’t seem to matter, in my example both users are administrators.

    I’ve tested this with the current plugin version (3.3.1), on the most recent WordPress 5.8.2, but also on the last version this plugin was tested with: 5.7.4, but the behaviour is the same. I’ve also disabled all other plugins and reverted to a stock theme, and even tried it on a bone stock installation. But the issue seems to always be there.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor nwjames

    (@nwjames)

    @millerleon
    Please see the thread “How is browser caching handled” as it describes the scenario that you are seeing.

    Essentially in you point 2, user 2 has downloaded the file with an expiry date in the future. When in point 5, they ask for the file by name, their browser says that they have the file and display it.

    If your user 2 were to clear their cache between steps 2 and 5 then I would expect them to see the later version.

    Alternatively you could add the code that I supply on that thread will achieve the same thing as it will tell the browser to check that it hasn’t been updated.

    Note. If running V3.3.0 of the plugin or earlier then an additional line must be added to the function:
    unset( $headers['Expire'] );

    Regards,
    Neil James

    Thread Starter millerleon

    (@millerleon)

    How did I miss this one, it’s even near the top!
    Your snippet seems to do the job. Thank you very much!

    Best regards,

    Leon Weggelaar

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Unexpected file served’ is closed to new replies.