Commit 19f7e1a3 authored by Romain Courteaud's avatar Romain Courteaud

[officejs_test] Cache configuration has been updated

parent e7e2242f
......@@ -140,7 +140,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
self.assertEquals(response.status, 200)
self.assertEquals(
response.getheader('Cache-Control'),
'max-age=0, public, must-revalidate'
'max-age=600, stale-while-revalidate=360000, stale-if-error=31536000, public'
)
self.assertTrue(
'text/html;' in response.getheader('Content-Type'),
......@@ -156,7 +156,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
)
self.assertEquals(
response.getheader('Vary').replace(' ', ''),
'Accept-Language,Cookie,Authorization,Accept-Encoding'
'Cookie,Authorization,Accept-Encoding'
)
......@@ -170,7 +170,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
page_content = response.read()
self.assertEquals("""CACHE MANIFEST
# development + hash""",
# development / %s""" % web_section.Base_getWebDocumentDrivenModificationDate().rfc822(),
page_content
)
self.assertEquals(response.status, 200)
......@@ -181,7 +181,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
)
self.assertEquals(
response.getheader('Cache-Control'),
'max-age=0, public, must-revalidate'
'max-age=600, stale-while-revalidate=360000, stale-if-error=31536000, public'
)
self.assertEquals(
response.getheader('Vary'),
......@@ -214,7 +214,10 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
response.getheader('X-Frame-Options'),
None
)
self.assertEquals(response.getheader('Vary'), None)
self.assertEquals(
response.getheader('Vary').replace(' ', ''),
'Cookie,Authorization,Accept-Encoding'
)
###################################
### User: open the publication to be accepted
......@@ -257,7 +260,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
self.assertEquals(response.status, 200)
self.assertEquals(
response.getheader('Cache-Control'),
'max-age=0, public, must-revalidate'
'max-age=600, stale-while-revalidate=360000, stale-if-error=31536000, public'
)
self.assertTrue(
'text/html;' in response.getheader('Content-Type'),
......@@ -273,7 +276,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
)
self.assertEquals(
response.getheader('Vary').replace(' ', ''),
'Accept-Language,Cookie,Authorization,Accept-Encoding'
'Cookie,Authorization,Accept-Encoding'
)
###################################
......@@ -305,7 +308,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
self.assertEquals(response.status, 200)
self.assertEquals(
response.getheader('Cache-Control'),
'max-age=0, public, must-revalidate'
'max-age=600, stale-while-revalidate=360000, stale-if-error=31536000, public'
)
self.assertTrue(
'text/html;' in response.getheader('Content-Type'),
......@@ -321,7 +324,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
)
self.assertEquals(
response.getheader('Vary').replace(' ', ''),
'Accept-Language,Cookie,Authorization,Accept-Encoding'
'Cookie,Authorization,Accept-Encoding'
)
###################################
......@@ -334,7 +337,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
page_content = response.read()
self.assertEquals("""CACHE MANIFEST
# %s + hash""" % web_section.getId(),
# %s / %s""" % (web_section.getId(), web_section.Base_getWebDocumentDrivenModificationDate().rfc822()),
page_content
)
self.assertEquals(response.status, 200)
......@@ -345,7 +348,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
)
self.assertEquals(
response.getheader('Cache-Control'),
'max-age=0, public, must-revalidate'
'max-age=600, stale-while-revalidate=360000, stale-if-error=31536000, public'
)
self.assertEquals(
response.getheader('Vary'),
......
......@@ -129,7 +129,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
self.assertEquals(response.status, 200)
self.assertEquals(
response.getheader('Cache-Control'),
'max-age=0, public, must-revalidate'
'max-age=600, stale-while-revalidate=360000, stale-if-error=31536000, public'
)
self.assertTrue(
'text/html;' in response.getheader('Content-Type'),
......@@ -145,7 +145,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
)
self.assertEquals(
response.getheader('Vary').replace(' ', ''),
'Accept-Language,Cookie,Authorization,Accept-Encoding'
'Cookie,Authorization,Accept-Encoding'
)
......@@ -159,7 +159,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
page_content = response.read()
self.assertEquals("""CACHE MANIFEST
# development + hash""",
# development / %s""" % web_section.Base_getWebDocumentDrivenModificationDate().rfc822(),
page_content
)
self.assertEquals(response.status, 200)
......@@ -170,7 +170,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
)
self.assertEquals(
response.getheader('Cache-Control'),
'max-age=0, public, must-revalidate'
'max-age=600, stale-while-revalidate=360000, stale-if-error=31536000, public'
)
self.assertEquals(
response.getheader('Vary'),
......@@ -203,7 +203,10 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
response.getheader('X-Frame-Options'),
None
)
self.assertEquals(response.getheader('Vary'), None)
self.assertEquals(
response.getheader('Vary').replace(' ', ''),
'Cookie,Authorization,Accept-Encoding'
)
###################################
### User: open the publication to be accepted
......@@ -246,7 +249,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
self.assertEquals(response.status, 200)
self.assertEquals(
response.getheader('Cache-Control'),
'max-age=0, public, must-revalidate'
'max-age=600, stale-while-revalidate=360000, stale-if-error=31536000, public'
)
self.assertTrue(
'text/html;' in response.getheader('Content-Type'),
......@@ -262,7 +265,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
)
self.assertEquals(
response.getheader('Vary').replace(' ', ''),
'Accept-Language,Cookie,Authorization,Accept-Encoding'
'Cookie,Authorization,Accept-Encoding'
)
###################################
......@@ -294,7 +297,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
self.assertEquals(response.status, 200)
self.assertEquals(
response.getheader('Cache-Control'),
'max-age=0, public, must-revalidate'
'max-age=600, stale-while-revalidate=360000, stale-if-error=31536000, public'
)
self.assertTrue(
'text/html;' in response.getheader('Content-Type'),
......@@ -310,7 +313,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
)
self.assertEquals(
response.getheader('Vary').replace(' ', ''),
'Accept-Language,Cookie,Authorization,Accept-Encoding'
'Cookie,Authorization,Accept-Encoding'
)
###################################
......@@ -323,7 +326,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
page_content = response.read()
self.assertEquals("""CACHE MANIFEST
# %s + hash""" % web_section.getId(),
# %s / %s""" % (web_section.getId(), web_section.Base_getWebDocumentDrivenModificationDate().rfc822()),
page_content
)
self.assertEquals(response.status, 200)
......@@ -334,7 +337,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
)
self.assertEquals(
response.getheader('Cache-Control'),
'max-age=0, public, must-revalidate'
'max-age=600, stale-while-revalidate=360000, stale-if-error=31536000, public'
)
self.assertEquals(
response.getheader('Vary'),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment