Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimpleHTTPRequestHandler should support browser cache #73840

Closed
PierreQuentel mannequin opened this issue Feb 25, 2017 · 7 comments
Closed

SimpleHTTPRequestHandler should support browser cache #73840

PierreQuentel mannequin opened this issue Feb 25, 2017 · 7 comments
Labels
3.7 stdlib type-feature

Comments

@PierreQuentel
Copy link
Mannequin

@PierreQuentel PierreQuentel mannequin commented Feb 25, 2017

BPO 29654
Nosy @vstinner, @PierreQuentel, @serhiy-storchaka
PRs
  • #298
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2017-04-02.10:27:13.993>
    created_at = <Date 2017-02-25.21:20:35.748>
    labels = ['3.7', 'type-feature', 'library']
    title = 'SimpleHTTPRequestHandler should support browser cache'
    updated_at = <Date 2017-07-31.22:35:58.707>
    user = 'https://github.com/PierreQuentel'

    bugs.python.org fields:

    activity = <Date 2017-07-31.22:35:58.707>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-04-02.10:27:13.993>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2017-02-25.21:20:35.748>
    creator = 'quentel'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 29654
    keywords = []
    message_count = 7.0
    messages = ['288581', '291028', '291029', '299405', '299472', '299543', '299588']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'v+python', 'quentel', 'serhiy.storchaka']
    pr_nums = ['298']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue29654'
    versions = ['Python 3.7']

    @PierreQuentel
    Copy link
    Mannequin Author

    @PierreQuentel PierreQuentel mannequin commented Feb 25, 2017

    SimpleHTTPServer send a Last-Modified response header, but doesn't take into account the If-Modified-Since header if it was sent by the user agent.

    If a url matches a file and this file was not modified after the value of the If-Modified-Since header, the server should return HTTP status 304 (Not Modified).

    @PierreQuentel PierreQuentel mannequin added 3.7 stdlib type-feature labels Feb 25, 2017
    @serhiy-storchaka
    Copy link
    Member

    @serhiy-storchaka serhiy-storchaka commented Apr 2, 2017

    New changeset 351adda by Serhiy Storchaka (Pierre Quentel) in branch 'master':
    bpo-29654 : Support If-Modified-Since HTTP header (browser cache) (#298)
    351adda

    @serhiy-storchaka
    Copy link
    Member

    @serhiy-storchaka serhiy-storchaka commented Apr 2, 2017

    Thank you for your contribution Pierre.

    @vstinner
    Copy link
    Member

    @vstinner vstinner commented Jul 28, 2017

    FYI there was a race condition, impacting Windows. I just fixed it: bpo-31066, commit 28ce07a.

    @PierreQuentel
    Copy link
    Mannequin Author

    @PierreQuentel PierreQuentel mannequin commented Jul 29, 2017

    Thanks for telling me. I must have run the test hundreds of times now, on a
    Windows 7 PC, and this bug never occured.

    Just for my information, why do you add temp.flush() in the "with" block ?
    I thought the context manager took care of this.

    2017-07-28 18:19 GMT+02:00 STINNER Victor <report@bugs.python.org>:

    STINNER Victor added the comment:

    FYI there was a race condition, impacting Windows. I just fixed it:
    bpo-31066, commit 28ce07a.

    ----------
    nosy: +haypo


    Python tracker <report@bugs.python.org>
    <http://bugs.python.org/issue29654\>


    @serhiy-storchaka
    Copy link
    Member

    @serhiy-storchaka serhiy-storchaka commented Jul 31, 2017

    Thank you Victor!

    I suppose temp.flush() is a remnant of other (unsuccessful) attempt to fix a race condition.

    @vstinner
    Copy link
    Member

    @vstinner vstinner commented Jul 31, 2017

    I suppose temp.flush() is a remnant of other (unsuccessful) attempt to fix
    a race condition.

    I didn't try only with .flush(). I prefer to explicitly .flush(), just in
    case :-) Using correctly a file system is complex because of all layers of
    caching.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 stdlib type-feature
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants