css - jQuery .load browser cache overrides body class transitions -


my .load ajax function:

1) click link

2) loads requested page while animating css transition (body add/remove class)

3) if page request loads quicker 400ms knows wait before removing body class , revealing page

this works on local dev environment. when on live server ajax page cache overrides body class transition , snap loads page on top, disregarding timer described above (3).

fixes i've found $.ajaxsetup({ cache: false }); adds string url browser thinks it's unique page... ugly.

what other work arounds possible? wait 400ms before loading each page, that's slow , un-pro :)

many in advance. tim

and fix...

in .htaccess add:

<filesmatch "\.(html|php|js|css)$">     fileetag none     <ifmodule mod_headers.c>         header unset etag         header set cache-control "max-age=0, no-cache, no-store, must-revalidate"         header set pragma "no-cache"         header set expires "wed, 11 jan 1984 05:00:00 gmt"     </ifmodule> </filesmatch> 

forces apache cache not store basic (listed) files.

phew


Comments